Apparatus and method of encoding an image using a statistical model based on pixels

ABSTRACT

A decoder decodes encoded binary image data on each block in order to recover a target block of the binary image. The image decoder includes motion compensated blocking which obtains a reference block from a reference binary image by applying motion compensation using motion information. A selector selects a statistical model from among a plurality of statistical models, based on states of pixels surrounding a reference pixel in the reference block, in which the reference pixel also corresponds to a target pixel in the target block. An arithmetic decoder recovers the target block by decoding the encoded data using the selected statistical model. In one embodiment, the pixels surrounding the reference pixel in the reference block are pixels positioned within one pixel distance from the reference pixel.

This application is a division of U.S. patent application Ser. No.09/846,164, filed May 1, 2001, now U.S. Pat. No. 6,510,250, which is adivision of Ser. No. 09/846,725, filed May 1, 2001, now U.S. Pat. No.6,490,373 which is a divisional of Ser. No. 09/230,755, filed Feb. 1,1999, now U.S. Pat. No. 6,404,932.

TECHNICAL FIELD

The present invention relates to an image encoding apparatus, an imagedecoding apparatus, an image encoding method, an image decoding method,and a medium, which may be utilized for the transmission and storage ofimages.

BACKGROUND ART

When compositing images, there are cases where information called analpha value indicating the overlay area and the degree of transparencyof an object is appended in addition to the luminance of the object. Thealpha value is determined for each pixel, an alpha value of 1 indicatingcomplete opacity or occlusion and an alpha value of 0 completetransparency or nonocclusion. Alpha values become necessary whenoverlaying an image of an object onto a background image. Hereinafter,an image represented only by such alpha values is called an alpha plane.

In the case of a cloud, frosted glass, etc., an alpha value intermediatebetween [0, 1] may be used to represent the image, but there are caseswhere two values {0, 1} are sufficient.

For the encoding of a conventional binary alpha plane, binary imagecoding techniques such as MR and MMR, defined in CCITT's internationalstandards traditionally used for facsimile systems, etc., or codingtechniques standardized by JBIG can be used. These coding schemes arereferred to generically as binary still image coding. In binary stillimage coding, efficient coding can be achieved by predicting a low orderpixel from a high order pixel in the scanning direction and byentropy-encoding the difference between them.

In a binary moving image, such as two successive alpha planes of amoving image, correlation between successive frames can be utilized.That is, efficient coding can be achieved by predicting a pixel to beencoded, from a previously obtained binary image having highcorrelation, and by encoding the difference between them, rather thanpredicting a low-order pixel from a high-order pixel in the scanningdirection and encoding the difference between them.

However, binary still image coding in the prior art has exploited onlythe correlation between the high-order and low-order pixels in thescanning direction even when a binary image having high correlation withthe binary image to be encoded or decoded is obtained at the encoder ordecoder, and hence the prior art has had the problem that a large numberof code bits are required.

For the encoding of a conventional alpha plane, waveform coding is used,as is done in the JPEG coding scheme.

However, many alpha planes have the property that most portions areuniform and intermediate values are distributed along the boundary.

Since such alpha planes contain high frequency components along theboundary, the waveform coding as employed in the prior art has had theproblem that efficient coding is difficult to achieve.

DISCLOSURE OF THE INVENTION

In view of the above-described problems of the prior art, it is anobject of the present invention to provide an image encoding apparatus,an image decoding apparatus, an image encoding method, an image decodingmethod, and a medium having recorded thereon a program which causes acomputer to carry out their processing operations, wherein a pixel to beencoded is predicted from a previously obtained binary image having highcorrelation, and the difference between them is encoded, therebyachieving more efficient encoding and decoding than can be achieved withthe binary image encoding and decoding techniques used in the prior art.

In view of the above-described problems, it is also an object of thepresent invention to provide an image encoding apparatus and itscorresponding decoding apparatus, an image encoding method and itscorresponding decoding method, and media storing their executionprograms, wherein the distribution of intermediate values is analyzed,and a smoothing function approximating the distribution and a binarybase image having only two values, a maximum value and a minimum value,are encoded respectively, thereby achieving more efficient coding thanthe prior art.

An aspect of present invention is an image encoding apparatuscomprising: blocking means 1 for taking as an input a target binaryimage to be encoded, and for obtaining a target block by dividing saidtarget binary image into blocks each containing a plurality of pixels;blocking means 2 for obtaining a reference block by dividing apreviously obtained reference binary image into blocks each containing aplurality of pixels;

exclusive OR block constructing means for constructing an exclusive ORblock by sequentially scanning said target block and said referenceblock and by exclusive-ORing pixel values between said two blocks; andexclusive OR encoding means for generating a coded sequencerepresentative of the results of said exclusive-ORing, and foroutputting the same as encoded data.

Another aspect of present invention is an image decoding apparatuscomprising: blocking means 2 for obtaining a reference block by dividinga previously obtained reference binary image into blocks each containinga plurality of pixels; exclusive OR decoding means for recovering saidexclusive OR block by decoding the encoded data encoded by the imageencoding apparatus; and target block constructing means for constructinga target block by combining said exclusive OR block with said referenceblock.

Another aspect of present invention is an image encoding apparatuscomprising: blocking means 1 for taking as an input a target binaryimage to be encoded, and for obtaining a target block by dividing saidtarget binary image into blocks each containing a plurality of pixels;blocking means 2 for obtaining a reference block by dividing apreviously obtained reference binary image into blocks each containing aplurality of pixels;

statistical model selecting means for selecting a statistical model fromamong a plurality of statistical models, based on the states of pixelssurrounding a reference pixel in said reference block, said referencepixel corresponding to a target pixel in said target block; and entropyencoding means for entropy-encoding said target pixel based on saidselected statistical model, and for outputting the same as encoded data.

Still another aspect of present invention is an image decoding apparatuscomprising: blocking means 2 for obtaining a reference block by dividinga previously obtained reference binary image into blocks each containinga plurality of pixels; statistical model selecting means for selecting astatistical model from among a plurality of statistical models, based onthe states of pixels surrounding a reference pixel in said referenceblock, said reference pixel corresponding to a target pixel in saidtarget block; and entropy decoding means for recovering said targetblock by entropy-decoding, based on said selected statistical model, theencoded data output from the image encoding apparatus.

Still another aspect of the present invention is an image encodingapparatus, further comprising: motion estimating means for searchingthrough said reference binary image for a block that most resembles saidtarget block, and for obtaining motion information from the result ofsaid searching, and wherein: said blocking means 2 is a motioncompensated blocking means 2 which obtains a reference block by applyingmotion compensation to said reference binary image using said motioninformation, and said motion information also is output from said imageencoding apparatus.

Still another aspect of the present invention is an image decodingapparatus, wherein said blocking means 2 is a motion compensatedblocking means 2 which obtains a reference block by applying motioncompensation to said previously obtained reference binary image usingthe motion information output from the image encoding apparatus.

Still another aspect of present invention is an image encodingapparatus, further comprising: reference block adoption determiningmeans for comparing said target block with said reference block, and fordetermining, based on the result of said comparison, whether saidreference block is to be adopted or not, and thereby switching theremainder of processing between various means; and target pixel encodingmeans for generating a coded sequence representative of pixel values insaid target block, and for outputting the same as encoded data, andwherein: when said reference block adoption determining means determinesthat said reference block is to be adopted, said entropy encoding meansand said statistical model selecting means are operated so that saidencoded data from said entropy encoding means is output, while on theother hand, when it is determined that said reference block is not to beadopted, said target pixel encoding means is operated so that saidencoded data from said target pixel encoding means is output, and theresult of the determination as to whether said reference block is to beadopted or not is output as a reference block adoption determiningsignal.

Still another aspect of the present invention is an image decodingapparatus, further comprising: reference block adoption control meansfor determining, based on the reference block adoption determiningsignal output from the image encoding apparatus, whether said referenceblock is to be adopted or not, and thereby switching the remainder ofprocessing between various means; and target pixel decoding means forrecovering said target block by decoding said encoded data output fromsaid image encoding apparatus, and wherein: when said reference blockadoption control means determines that said reference block is to beadopted, said entropy decoding means and said statistical modelselecting means are operated so that said target block from said entropydecoding means is output, while on the other hand, when it is determinedthat said reference block is not to be adopted, said target pixeldecoding means is operated so that said target block from said targetpixel decoding means is output.

Still another aspect of the present invention is an image encodingapparatus comprising: blocking means 1 for taking as an input a targetbinary image to be encoded, and for obtaining a target block by dividingsaid target binary image into blocks each containing a plurality ofpixels; blocking means 2 for obtaining a reference block by dividing apreviously obtained reference binary image into blocks each containing aplurality of pixels; statistical model generating means for generating astatistical model for a target pixel from said reference block; andentropy encoding means for entropy-encoding said target pixel based onsaid generated statistical model, and for outputting the same as encodeddata.

Still another aspect of present invention is an image decoding apparatuscomprising: blocking means 2 for obtaining a reference block by dividinga previously obtained reference binary image into blocks each containinga plurality of pixels; statistical model generating means for generatinga statistical model for a target pixel from said reference block; andentropy decoding means for recovering said target block byentropy-decoding, based on said generated statistical model, the encodeddata output from the image encoding apparatus.

Still another aspect of the present invention is an image encodingmethod comprising the steps of: taking as an input a target binary imageto be encoded, and obtaining a target block by dividing said targetbinary image into blocks each containing a plurality of pixels;obtaining a reference block by dividing a previously obtained referencebinary image into blocks each containing a plurality of pixels;constructing an exclusive OR block by sequentially scanning said targetblock and said reference block and by exclusive-ORing pixel valuesbetween said two blocks; and generating a coded sequence representativeof the results of said exclusive-ORing, and outputting the same asencoded data.

Still another aspect of the present invention is an image decodingmethod comprising the steps of: obtaining a reference block by dividinga previously obtained reference binary image into blocks each containinga plurality of pixels; taking the encoded data encoded by the imageencoding method as an input, and recovering said exclusive OR block bydecoding said encoded data; and constructing a target block by combiningsaid exclusive OR block with said reference block.

Still another aspect of the present invention is an image encodingmethod comprising: blocking step 1 for taking as an input a targetbinary image to be encoded, and for obtaining a target block by dividingsaid target binary image into blocks each containing a plurality ofpixels; blocking step 2 for obtaining a reference block by dividing apreviously obtained reference binary image into blocks each containing aplurality of pixels; statistical model selecting step for selecting astatistical model from among a plurality of statistical models, based onthe states of pixels surrounding a reference pixel in said referenceblock, said reference pixel corresponding to a target pixel in saidtarget block; and entropy encoding step for entropy-encoding said targetpixel based on said selected statistical model, and for outputting thesame as encoded data.

Still another aspect of the present invention is an image decodingmethod comprising: blocking step 2 for obtaining a reference block bydividing a previously obtained reference binary image into blocks eachcontaining a plurality of pixels; statistical model selecting step forselecting a statistical model from among a plurality of statisticalmodels, based on the states of pixels surrounding a reference pixel insaid reference block, said reference pixel corresponding to a targetpixel in said target block; and entropy decoding step for recoveringsaid target block by entropy-decoding, based on said selectedstatistical model, the encoded data output in accordance with the imageencoding method.

Still another aspect of the present invention is an image encodingmethod, further comprising: motion estimating step for searching throughsaid reference binary image for a block that most resembles said targetblock, and for obtaining motion information from the result of saidsearching, and wherein: said blocking step 2 is a motion compensatedblocking step 2 which obtains a reference block by applying motioncompensation to said reference binary image using said motioninformation, and said motion information also is output from said imageencoding method.

Still another aspect of the present invention of claim 31 is an imagedecoding method, wherein said blocking step 2 is a motion compensatedblocking step 2 which obtains a reference block by applying motioncompensation to said previously obtained reference binary image usingthe motion information output in accordance with the image encodingmethod.

Still another aspect of the present invention is an image encodingmethod, further comprising: reference block adoption determining stepfor comparing said target block with said reference block, and fordetermining, based on the result of said comparison, whether saidreference block is to be adopted or not, and thereby switching theexecution of subsequent steps; and target pixel encoding step forgenerating a coded sequence representative of pixel values in saidtarget block, and for outputting the same as encoded data, and wherein:when it is determined in said reference block adoption determining stepthat said reference block is to be adopted, said entropy encoding stepand said statistical model selecting step are executed so that saidencoded data from said entropy encoding step is output, while on theother hand, when it is determined that said reference block is not to beadopted, said target pixel encoding step is executed so that saidencoded data from said target pixel encoding step is output, and theresult of the determination as to whether said reference block is to beadopted or not is output as a reference block adoption determiningsignal.

Still another aspect of the present invention is an image decodingmethod, further comprising: reference block adoption control step fordetermining, based on the reference block adoption determining signaloutput in accordance with the image encoding method, whether saidreference block is to be adopted or not, and thereby switching theexecution of subsequent steps; and target pixel decoding step forrecovering said target block by decoding said encoded data output inaccordance with said image encoding method, and wherein: when it isdetermined in said reference block adoption control step that saidreference block is to be adopted, said entropy decoding step and saidstatistical model selecting step are executed so that said target blockfrom said entropy decoding step is output, while on the other hand, whenit is determined that said reference block is not to be adopted, saidtarget pixel decoding step is executed so that said target block fromsaid target pixel decoding step is output.

Still another aspect of the present invention is an image encodingmethod comprising the steps of: taking as an input a target binary imageto be encoded, and obtaining a target block by dividing said targetbinary image into blocks each containing a plurality of pixels;obtaining a reference block by dividing a previously obtained referencebinary image into blocks each containing a plurality of pixels;generating a statistical model for a target pixel from said referenceblock; and entropy-encoding said target pixel based on said generatedstatistical model, and outputting the same as encoded data.

Still another aspect of the present invention is an image decodingmethod comprising: obtaining a reference block by dividing a previouslyobtained reference binary image into blocks each containing a pluralityof pixels; generating a statistical model for a target pixel from saidreference block; and recovering said target block by entropy-decoding,based on said generated statistical model, the encoded data output inaccordance with the image encoding method.

Still another aspect of the present invention is an image encodingapparatus comprising: multi-value to binary converting means for takinga target multi-value image to be encoded and a smoothing function asinputs, and for generating a binary image from said multi-value image onthe basis of said smoothing function; binary image encoding means forencoding said binary image, and for outputting the same as binary imageencoded data; and smoothing function encoding means for encoding saidsmoothing function, and for outputting the same as smoothing functionencoded data, and wherein: said smoothing function is a function soadjusted that the original multi-value image could, in effect, bereproduced if said smoothing function were applied to said binary image.

Still another aspect of the present invention is an image encodingapparatus comprising: smoothing function estimating means for estimatinga smoothing function from a target multi-value image to be encoded;multi-value to binary converting means for converting said multi-valueimage to a binary image based on a multi-value to binary conversioncriterion determined to match said estimated smoothing function; binaryimage encoding means for encoding said binary image, and for outputtingthe same as binary image encoded data; and smoothing function encodingmeans for encoding said estimated smoothing function, and for outputtingthe same as smoothing function encoded data.

Still another aspect of the present invention is an image encodingapparatus comprising: multi-value to binary converting means forgenerating a binary image from a target multi-value image to be encoded;binary image encoding means for encoding said binary image, and foroutputting the same as binary image encoded data; smoothing functiongenerating means for generating a smoothing function from said binaryimage and said target multi-value image; and smoothing function encodingmeans for encoding said smoothing function, and for outputting the sameas smoothing function encoded data.

Still another aspect present invention is an image encoding apparatus,wherein said smoothing function is expressed using one or more tablesconsisting of binarization patterns of neighboring pixels andsubstitution values corresponding to said patterns.

Still another aspect of the present invention is an image encodingapparatus, further comprising: binary to multi-value converting meansfor generating a multi-value image by smoothing said binary image usingsaid smoothing function; and residual component encoding means forencoding a residual component existing between the multi-value imagegenerated by said binary to multi-value converting means and said targetmulti-value image input for conversion by said multi-value to binaryconverting means.

Still another aspect of the present invention is an image encodingapparatus comprising: multi-value to binary converting means forconverting a multi-value image, which is a target image to be encoded,to a binary image based on a multi-value to binary conversion criteriondetermined to match said multi-value image; smoothing functionestimating means for estimating a smoothing function such that theoriginal multi-value image could, in effect, be reproduced if saidsmoothing function were applied to said binary image; binary imageencoding means for encoding said binary image, and for outputting thesame as binary image encoded data; and smoothing function encoding meansfor encoding said estimated smoothing function, and for outputting thesame as smoothing function encoded data.

Still another aspect of the present invention is an image decodingapparatus comprising: means for receiving as inputs thereto the variousencoded data encoded by the image encoding apparatus; binary imagedecoding means for recovering said binary image by decoding said binaryimage encoded data out of said encoded data; smoothing function decodingmeans for recovering said smoothing function by decoding said smoothingfunction encoded data out of said encoded data; and binary tomulti-value converting means for recovering said multi-value image bysmoothing said decoded binary image using said decoded smoothingfunction.

Still another aspect of the present invention is an image decodingapparatus comprising: means for receiving as inputs thereto the variousencoded data encoded by the image encoding apparatus; binary imagedecoding means for recovering said binary image by decoding said binaryimage encoded data out of said encoded data; smoothing function decodingmeans for recovering said smoothing function by decoding said smoothingfunction encoded data out of said encoded data; dynamic range decodingmeans for recovering said dynamic range by decoding said dynamic rangeencoded data out of said encoded data; and binary to multi-valueconverting means for recovering said multi-value image by smoothing saiddecoded binary image using said decoded smoothing function and byconverting pixel values using said decoded dynamic range.

Still another aspect of the present invention is an image decodingapparatus comprising: means for receiving as inputs thereto the variousencoded data encoded by the image encoding apparatus; binary imagedecoding means for recovering said binary image by decoding said binaryimage encoded data out of said encoded data; smoothing function decodingmeans for recovering said smoothing function by decoding said smoothingfunction encoded data out of said encoded data; and binary tomulti-value converting means for recovering said multi-value image bysmoothing said decoded binary image using said decoded smoothingfunction, and wherein: said decoded smoothing function is expressedusing one or more tables consisting of binarization patterns ofneighboring pixels and substitution values corresponding to saidpatterns.

Still another aspect of the present invention is an image decodingapparatus comprising: means for receiving as inputs thereto the variousencoded data encoded by the image encoding apparatus; binary imagedecoding means for recovering said binary image by decoding said binaryimage encoded data out of said encoded data; smoothing function decodingmeans for recovering said smoothing function by decoding said smoothingfunction encoded data out of said encoded data; binary to multi-valueconverting means for recovering said multi-value image by smoothing saiddecoded binary image using said decoded smoothing function; and residualcomponent decoding means for decoding said residual component, andwherein: an output image is obtained by adding said decoded residualcomponent to the output from said binary to multi-value convertingmeans.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an image encoding apparatus according to anA1st embodiment of the present invention.

FIG. 2 is a block diagram of an image decoding apparatus according to anA2nd embodiment of the present invention.

FIG. 3 is a block diagram of an image encoding apparatus according to anA3rd embodiment of the present invention.

FIG. 4 is a block diagram of an image decoding apparatus according to anA4th embodiment of the present invention.

FIG. 5 is a block diagram of an image encoding apparatus according to anA5th embodiment of the present invention.

FIG. 6 is a block diagram of an image decoding apparatus according to anA6th embodiment of the present invention.

FIG. 7 is a block diagram of an image encoding apparatus according to anA7th embodiment of the present invention.

FIG. 8 is a block diagram of an image decoding apparatus according to anA8th embodiment of the present invention.

FIG. 9 is a block diagram of an image encoding apparatus according to anA9th embodiment of the present invention.

FIG. 10 is a block diagram of an image decoding apparatus according toan A10th embodiment of the present invention.

FIG. 11 is a block diagram of an image encoding apparatus according toan A11th embodiment of the present invention.

FIG. 12 is a block diagram of an image decoding apparatus according toan A12th embodiment of the present invention.

FIG. 13 is a block diagram of an image encoding apparatus according toan A13th embodiment of the present invention.

FIG. 14 is a block diagram of an image decoding apparatus according toan A14th embodiment of the present invention.

FIG. 15 is a block diagram of an image encoding apparatus according toan A15th embodiment of the present invention.

FIG. 16 is a block diagram of an image decoding apparatus according toan A16th embodiment of the present invention.

FIG. 17 is a block diagram of an image encoding apparatus according toan A17th embodiment of the present invention.

FIG. 18 is a block diagram of an image decoding apparatus according toan A18th embodiment of the present invention.

FIG. 19 is a diagram showing a reference image and target image in amask moving image.

FIG. 20 is a diagram for explaining how an exclusive OR block isconstructed.

FIG. 21 is a diagram for explaining the principle of arithmetic coding.

FIG. 22 is a block diagram for arithmetic coding.

FIG. 23 is a diagram showing a portion of a statistical model table.

FIG. 24 is a diagram showing a portion of the statistical model table.

FIG. 25 is a diagram showing a portion of the statistical model table.

FIG. 26 is a diagram showing a portion of the statistical model table.

FIG. 27 is a diagram for explaining extrapolated reference blocks.

FIG. 28 is a diagram for explaining indices in the statistical modeltable.

FIG. 29 is a diagram for explaining a frequency to generationprobability conversion graph.

FIG. 30 is a block diagram of an image encoding apparatus according toanother embodiment of the present invention.

FIG. 31 is a block diagram of an image decoding apparatus according tothe same embodiment.

FIG. 32 is a block diagram of an image encoding apparatus according tostill another embodiment of the present invention.

FIG. 33 is a block diagram of an image decoding apparatus according tothe same embodiment.

FIG. 34 is a block diagram of an image encoding apparatus according toyet another embodiment of the present invention.

FIG. 35 is a block diagram of an image decoding apparatus according tothe same embodiment.

FIG. 36 is a block diagram of an image encoding apparatus according to aB1st embodiment of the present invention.

FIG. 37 is a diagram showing a multi-value image used in the sameembodiment.

FIG. 38 is a distribution diagram of pixels values along line A-B inFIG. 37.

FIG. 39 is a block diagram of a smoothing function estimating meansaccording to the B1st embodiment.

FIG. 40 is a diagram for explaining non-maximum value suppression usedin the embodiment.

FIG. 41 is a diagram showing the correspondence between normalizedaverage gradient and smoothing filter according to the B1st embodiment.

FIG. 42 is a diagram for explaining the smoothing filter according tothe B1st embodiment.

FIG. 43 is a diagram for explaining smoothing filter step responsesaccording to the B1st embodiment.

FIG. 44 is a diagram for explaining thresholding used in the embodiment.

FIG. 45 is a block diagram of an image decoding apparatus according to aB2nd embodiment.

FIG. 46 is a diagram for explaining pixel value conversion used in theembodiment.

FIG. 47 is a block diagram of an image encoding apparatus according to aB3rd embodiment.

FIG. 48 is a block diagram of a smoothing function estimating meansaccording to the B3rd embodiment.

FIG. 49 is a diagram showing the correspondence between normalizedaverage gradient and smoothing filter according to the B3rd embodiment.

FIG. 50 is a diagram for explaining the smoothing filter according tothe B3rd embodiment.

FIG. 51 is a diagram for explaining smoothing filter step responsesaccording to the B1st embodiment.

FIG. 52 is a diagram for explaining a morphological filter in theembodiment.

FIG. 53 is a block diagram of an image decoding apparatus according to aB4th embodiment.

FIG. 54 is a block diagram of an image encoding apparatus according to aB5th embodiment.

FIG. 55 is a block diagram of a smoothing function estimating meansaccording to the B5th embodiment.

FIG. 56 is a diagram for explaining a smoothing filter according to theB5th embodiment.

FIG. 57 is a block diagram of an image decoding apparatus according to aB6th embodiment.

FIG. 58 is a block diagram of an image encoding apparatus according to aB7th embodiment.

FIG. 59 is a block diagram of an image decoding apparatus according to aB8th embodiment.

FIG. 60 is a diagram for explaining a smoothing pattern in the B7th,B8th, B9th, and B10st embodiments.

FIG. 61 is a diagram for explaining multi-stage smoothing in the B7th,B8th, B9th, and B10st embodiments.

FIG. 62 is a block diagram of an image encoding apparatus according tothe B9th embodiment.

FIG. 63 is a block diagram of an image decoding apparatus according tothe B10st embodiment.

FIG. 64 is a block diagram of an image encoding apparatus according to aB11th embodiment.

FIG. 65 is a block diagram of an image encoding apparatus in a modifiedexample of the B1st embodiment.

FIG. 66 is a block diagram of an image encoding apparatus according toanother embodiment of the present invention.

FIG. 67 is a block diagram of an image encoding apparatus in a modifiedexample of the embodiment shown in FIG. 66.

FIG. 68 is a block diagram of an image encoding apparatus in a modifiedexample of the B11st embodiment.

FIG. 69 is a block diagram of an image decoding apparatus according toanother embodiment of the present invention.

DESCRIPTION OF NUMERALS

101. BLOCKING MEANS 1

102. BLOCKING MEANS 2

103. EXCLUSIVE OR BLOCK CONSTRUCTING MEANS

104. EXCLUSIVE OR ENCODING MEANS

201. EXCLUSIVE OR DECODING MEANS

202. BLOCKING MEANS 2

203. TARGET BLOCK CONSTRUCTING MEANS

301. BLOCKING MEANS 1

302. MOTION COMPENSATED BLOCKING MEANS 2

303. EXCLUSIVE OR BLOCK CONSTRUCTING MEANS

304. EXCLUSIVE OR ENCODING MEANS

305. MOTION ESTIMATING MEANS

401. EXCLUSIVE OR DECODING MEANS

402. MOTION COMPENSATED BLOCKING MEANS 2

403. TARGET BLOCK CONSTRUCTING MEANS

501. BLOCKING MEANS 1

502. BLOCKING MEANS 2

503. EXCLUSIVE OR BLOCK CONSTRUCTING MEANS

504. EXCLUSIVE OR ENCODING MEANS

505. REFERENCE BLOCK ADOPTION DETERMINING MEANS

506. TARGET PIXEL ENCODING MEANS

601. EXCLUSIVE OR DECODING MEANS

602. BLOCKING MEANS 2

603. TARGET BLOCK CONSTRUCTING MEANS

604. REFERENCE BLOCK ADOPTION CONTROL MEANS

605. TARGET PIXEL DECODING MEANS

701. BLOCKING MEANS 1

702. BLOCKING MEANS 2

703. STATISTICAL MODEL ESTIMATING MEANS

704. STATISTICAL MODEL

705. ENTROPY ENCODING MEANS

801. ENTROPY DECODING MEANS

802. BLOCKING MEANS 2

803. STATISTICAL MODEL ESTIMATING MEANS

804. STATISTICAL MODEL

901. BLOCKING MEANS 1

902. MOTION COMPENSATED BLOCKING MEANS

903. STATISTICAL MODEL ESTIMATING MEANS

904. STATISTICAL MODEL

905. ENTROPY ENCODING MEANS

906. MOTION ESTIMATING MEANS

1001. ENTROPY DECODING MEANS

1002. MOTION COMPENSATED BLOCKING MEANS 2

1003. STATISTICAL MODEL SELECTING MEANS

1004. STATISTICAL MODEL TABLE

1101. BLOCKING MEANS 1

1102. BLOCKING MEANS 2

1103. STATISTICAL MODEL SELECTING MEANS

1104. STATISTICAL MODEL TABLE

1105. ENTROPY ENCODING MEANS

1106. REFERENCE BLOCK ADOPTION DETERMINING MEANS

1107. TARGET PIXEL ENCODING MEANS

1201. ENTROPY DECODING MEANS

1202. BLOCKING MEANS 2

1203. STATISTICAL MODEL SELECTING MEANS

1204. STATISTICAL MODEL TABLE

1205. REFERENCE BLOCK ADOPTION CONTROL MEANS

1206. TARGET PIXEL DECODING MEANS

1301. BLOCKING MEANS 1

1302. BLOCKING MEANS 2

1303. STATISTICAL MODEL ESTIMATING MEANS

1304. STATISTICAL MODEL

1305. ENTROPY ENCODING MEANS

1401. ENTROPY DECODING MEANS

1402. BLOCKING MEANS 2

1403. STATISTICAL MODEL ESTIMATING MEANS

1404. STATISTICAL MODEL

1501. BLOCKING MEANS 1

1502. MOTION COMPENSATED BLOCKING MEANS 2

1503. ENTROPY ENCODING MEANS

1504. STATISTICAL MODEL ESTIMATING MEANS

1505. STATISTICAL MODEL

1506. MOTION ESTIMATING MEANS

1601. ENTROPY DECODING MEANS

1602. MOTION COMPENSATED BLOCKING MEANS 2

1603. STATISTICAL MODEL ESTIMATING MEANS

1604. STATISTICAL MODEL

1701. BLOCKING MEANS 1

1702. BLOCKING MEANS 2

1703. STATISTICAL MODEL ESTIMATING MEANS

1704. STATISTICAL MODEL

1705. ENTROPY ENCODING MEANS

1706. REFERENCE BLOCK ADOPTION DETERMINING MEANS

1707. TARGET PIXEL ENCODING MEANS

1801. ENTROPY DECODING MEANS

1802. BLOCKING MEANS 2

1803. STATISTICAL MODEL ESTIMATING MEANS

1804. STATISTICAL MODEL

1805. REFERENCE BLOCK ADOPTION CONTROL MEANS

1806. TARGET PIXEL DECODING MEANS

1901. MASK MOVING IMAGE

1902. REFERENCE IMAGE

1903. TARGET IMAGE

1904. REFERENCE BLOCK IMAGE

1905. TARGET BLOCK IMAGE

2001. REFERENCE BLOCK

2002. TARGET BLOCK

2003. EXCLUSIVE OR BLOCK

2101. NUMBER LINE

2102. RANGE

2103. BINARY POINT

2104. GENERATION PROBABILITY MODEL

2105. SYMBOL STRING

2201. START

2202. INITIALIZE RANGE

2203. INPUT SYMBOL

2204. LIMIT RANGE

2205. END SYMBOL?

2206. OUTPUT BINARY POINT

2207. END

2301. STATISTICAL MODEL TABLE

2401. REFERENCE BLOCK

2402. EXTRAPOLATED REFERENCE BLOCK

2403. EXTRAPOLATED REFERENCE BLOCK

2501. REFERENCE BLOCK

2502. TARGET BLOCK

2503. REFERENCE MASK

2504. TARGET MASK

2601. CONVERSION GRAPH

10101. DYNAMIC RANGE ESTIMATING MEANS

10102. SMOOTHING FUNCTION ESTIMATING MEANS

10103. MULTI-VALUE TO BINARY CONVERTING MEANS

10104. BINARY IMAGE ENCODING MEANS

10105. DYNAMIC RANGE ENCODING MEANS

10106. SMOOTHING FUNCTION ENCODING MEANS

10201. MULTI-VALUE IMAGE

10301. X-DIRECTION FILTERING

10302. Y-DIRECTION FILTERING

10303. GRADIENT DETECTION

10304. GRADIENT DIRECTION DETECTION

10305. NON-MAXIMUM VALUE SUPPRESSION

10306. AVERAGE GRADIENT DETECTION

10307. SMOOTHING FUNCTION SELECTION

10601. FILTER 1

10602. FILTER 2

10603. FILTER 3

10604. FILTER 4

10901. BINARY IMAGE DECODING MEANS

10902. SMOOTHING FUNCTION DECODING MEANS

10903. DYNAMIC RANGE DECODING MEANS

10904. BINARY TO MULTI-VALUE CONVERTING MEANS

10905. BINARY MASK APPLYING MEANS

11101. DYNAMIC RANGE ESTIMATING MEANS

11102. SMOOTHING FUNCTION ESTIMATING MEANS

11103. MULTI-VALUE TO BINARY CONVERTING MEANS

11104. BINARY IMAGE ENCODING MEANS

11105. DYNAMIC RANGE ENCODING MEANS

11106. SMOOTHING FUNCTION ENCODING MEANS

11201. X-DIRECTION FILTERING

11202. Y-DIRECTION FILTERING

11203. GRADIENT DETECTION

11204. GRADIENT DIRECTION DETECTION

11205. NON-MAXIMUM VALUE SUPPRESSION

11206. AVERAGE GRADIENT DETECTION

11207. SMOOTHING FUNCTION CONSTRUCTION

11401. SMOOTHING FILTER STEP 2

11402. SMOOTHING FILTER STEP 3

11403. SMOOTHING FILTER STEP 4

11404. SMOOTHING FILTER COEFFICIENT TABLE

11601. MORPHOLOGICAL FILTER 1

11602. MORPHOLOGICAL FILTER 2

11603. MORPHOLOGICAL FILTER 3

11701. BINARY IMAGE DECODING MEANS

11702. SMOOTHING FUNCTION DECODING MEANS

11703. DYNAMIC RANGE DECODING MEANS

11704. BINARY TO MULTI-VALUE CONVERTING MEANS

11801. DYNAMIC RANGE ESTIMATING MEANS

11802. SMOOTHING FUNCTION ESTIMATING MEANS

11803. MULTI-VALUE TO BINARY CONVERTING MEANS

11804. BINARY IMAGE ENCODING MEANS

11805. DYNAMIC RANGE ENCODING MEANS

11806. SMOOTHING FUNCTION COEFFICIENT ENCODING MEANS

11901. X-DIRECTION FILTERING

11902. Y-DIRECTION FILTERING

11903. GRADIENT DETECTION

11904. GRADIENT DIRECTION DETECTION

11905. NON-MAXIMUM VALUE SUPPRESSION

11906. AVERAGE GRADIENT DETECTION

11907. SMOOTHING FUNCTION GENERATION

12101. BINARY IMAGE DECODING MEANS

12102. SMOOTHING FUNCTION COEFFICIENT DECODING MEANS

12103. DYNAMIC RANGE DECODING MEANS

12104. BINARY TO MULTI-VALUE CONVERTING MEANS

12201. MULTI-VALUE TO BINARY CONVERTING MEANS

12202. BINARY IMAGE ENCODING MEANS

12203. SMOOTHING FUNCTION ESTIMATING MEANS

12204. SMOOTHING FUNCTION ENCODING MEANS

12301. BINARY IMAGE DECODING MEANS

12302. SMOOTHING FUNCTION DECODING MEANS

12303. BINARY TO MULTI-VALUE CONVERTING MEANS

12601. MULTI-VALUE TO BINARY CONVERTING MEANS

12602. BINARY IMAGE ENCODING MEANS

12603. SMOOTHING FUNCTION ESTIMATING MEANS

12604. SMOOTHING FUNCTION ENCODING MEANS

12605. BINARY TO MULTI-VALUE CONVERTING MEANS

12606. DIFFERENCE CALCULATOR

12607. RESIDUAL ENCODING MEANS

12701. BINARY IMAGE DECODING MEANS

12702. SMOOTHING FUNCTION DECODING MEANS

12703. BINARY TO MULTI-VALUE CONVERTING MEANS

12704. RESIDUAL DECODING MEANS

12705. ADDER

BEST MODE FOR CARRYING OUT THE INVENTION

Embodiments according to the present invention will be described belowwith reference to the accompanying drawings.

Embodiment A1

FIG. 1 is a block diagram showing the configuration of an image encodingapparatus according to an embodiment of the present invention.

In FIG. 1, blocking means 1 (101) is a means which takes as an input atarget image to be encoded, and which divides the input image intoblocks each consisting of a plurality of pixels. Blocking means 2 (102)is a means which divides a previously obtained reference image intoblocks each consisting of a plurality of pixels. Exclusive OR blockconstructing means (103) is a means which constructs an exclusive ORblock by scanning a target block taken from the image divided by theblocking means 1 (101) and a reference block taken from the imagedivided by the blocking means 2 (102), and by exclusive-ORing pixelvalues between them. Exclusive OR encoding means (104) is a means whichencodes the exclusive OR block and outputs the encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

Here, the (t+1)th frame (1903) of a person's moving mask image (1901),shown in FIG. 19, is taken as a target binary image, and the t-th frame(1902) as a reference binary image. In the diagrams hereinafterdescribed, value 1 is represented by black and value 0 by white. Thetarget binary image (1903) is divided by the blocking means 1 (101) intotarget blocks of 8×8 pixels, as shown in a target block image (1905).Image blocking in the blocking means 1 (101), however, is not limited toblocks of 8×8 pixels or 16×16 pixels. The reference binary image (1902)is likewise divided into reference blocks, as shown in a reference blockimage (1904).

The reference binary image (1902) is divided by the blocking means 2(102) into reference blocks of 8×8 pixels, as shown in the referenceblock image (1904). Image blocking in the blocking means 2 (102),however, is not limited to blocks of 8×8 pixels or 16×16 pixels.

The target block (2002) shown in FIG. 20 is one block taken from thetarget block image (1905). The reference block (2001) shown is oneblock, taken from the reference block image (1904), that matches thetarget block (2002). The exclusive OR block constructing means (103)scans the target block (2002) and the reference block (2001) from topleft to bottom right, exclusive-ORs the pixels values between them, andthereby constructs the exclusive OR block (2003). The exclusive OR block(2003), consisting of 0s and 1s, is encoded by the exclusive OR encodingmeans (104) using a technique generally known as arithmetic coding.Arithmetic coding will be briefly described below (refer to HiroshiYasuda, “International Standards for Multimedia Encoding,” Chapter 3Arithmetic Coding, published by Maruzen).

FIG. 21 is a diagram for explaining the principle of arithmetic coding.In arithmetic coding, using a symbol string (2105) and a symbolgeneration probability model (2104), a number line (2101) from 0 to 1 issuccessively limited with each input of a symbol from the symbol string(2105), and the shortest binary point (2103) that does not go outsidethe obtained range (2102) whatever follows next is output as the encodeddata.

FIG. 22 shows a flowchart for arithmetic coding. In 2201, arithmeticcoding is started. In 2202, the range is initialized to an intervalbounded by 0 and 1. In 2203, a symbol is input. In 2204, a generationprobability model is assigned to the current range, and the probabilityrange of the input symbol is set as the new range. In 2205, if thesymbol is an end symbol, then in 2206 the range is expressed by a binarypoint which is output, and the arithmetic coding is terminated in 2207.If, in 2205, the symbol is not an end symbol, then the next symbol isinput in 2203. If the number of symbols is predetermined, the end symbolcan be omitted.

Decoding is performed by determining the symbol string from the binarypoint. It is known that arithmetic coding has the property that thebetter the symbol matches the generation probability model of thesymbol, and the more biased the symbol generation probability is, thefewer the code bits to encode the symbol string. It is also known thateven if the generation probability model is changed during the encoding,decoding can be done if the way the model is changed is known.

Using the above-descried arithmetic coding and a generation probabilitymodel with [0, 0.9) as symbol 0 and [0.9, 1.0) as symbol 1, theexclusive OR encoding means (104) generates a coded sequence for theexclusive OR block consisting of a symbol string of 0s and 1s, andoutputs the same as encoded data.

As described above, in the present embodiment, efficient encoding withfewer code bits can be achieved by utilizing the property that in thecase of a mask moving image or the like, the generation probabilities ofsymbol 0 and symbol 1 from the exclusive ORing of the target block andreference block are at a ratio of about 9:1, and by combining theexclusive ORing with the arithmetic coding.

Embodiment A2

FIG. 2 is a block diagram showing the configuration of an image decodingapparatus according to an embodiment of the present invention. Theconfiguration of this embodiment will be described with reference tosame figure.

In the figure, exclusive OR decoding means (201) is a means which takesthe encoded data as an input and decodes it to recover the exclusive ORblock. Blocking means 2 (202) is a means which divides a previouslyobtained reference image into reference blocks each consisting of aplurality of pixels. Target block constructing means (203) is a meanswhich recovers the target block from the exclusive OR block suppliedfrom the exclusive OR decoding means (201) and a reference blocksupplied from the blocking means (202).

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

The exclusive OR decoding means (201) is a decoder for arithmetic codingthat has a generation probability model with [0, 0.9) as symbol 0 and[0.9, 1.0) as symbol 1, as does the exclusive OR encoding means (104).The exclusive OR block is constructed by generating a symbol string fromthe binary point as the encoded data and the generation probabilitymodel, and by arranging the symbols in the scanning direction.

In operation, the blocking means 2 (202) is equivalent to the blockingmeans 2 (102). The target block constructing means (203) constructs thetarget block by scanning the exclusive OR block and the reference block,and by inverting pixel values in the reference block for pixels whosevalues in the exclusive OR block are 1.

As described above, in the present embodiment, efficient decoding withfewer code bits can be achieved by utilizing the property that in thecase of a mask moving image or the like, the generation probabilities ofsymbol 0 and symbol 1 from the exclusive ORing of the target block andreference block is at a ratio of about 9:1, and by combining theexclusive ORing with the arithmetic coding.

Embodiment A3

FIG. 3 is a block diagram showing the configuration of an image encodingapparatus according to an embodiment of the present invention. Theconfiguration of this embodiment will be described below with referenceto same figure.

In the figure, blocking means 1 (301) is a mean which takes as an inputa target image to be encoded, and which divides the input image intoblocks each consisting of a plurality of pixels. Motion estimating means(305) is a means which searches through a reference image for a blockthat resembles the target block, and which generates a motion vector forthe block. Motion compensated blocking means 2 (302) is a means whichtakes the reference image and motion information as inputs and which,based on the motion information, divides the input reference image intoblocks each consisting of a plurality of pixels. Exclusive OR blockconstructing means (303) is a means which constructs an exclusive ORblock by scanning a target block taken from the image divided by theblocking means 1 (301) and a reference block taken from the imagedivided by the motion compensated blocking means 2 (302), and byexclusive-ORing pixel values between them. Exclusive OR encoding means(304) is a means which encodes the exclusive OR block and outputs theencoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

In operation, the blocking means 1 (301) is equivalent to the blockingmeans 1 (101). When the motion vector to be estimated is denoted by v,the number of pixels in the target block by m, the location of eachpixel in the image by u_i (i is 1 to m), the pixel value at location xin the target image by A(x), and the pixel value at location x in thereference image by B(x), the motion estimating means (305) detects fromwithin a predetermined range the v that minimizes the similarity S(v)(equation A1), and outputs the v as the motion vector.

Equation A1 $\begin{matrix}{{S(v)} = {\sum\limits_{i = 1}^{m}{{{A\left( {{u\quad \_ \quad i} + v} \right)} - {B\left( {u\quad \_ \quad i} \right)}}}}} & (1)\end{matrix}$

The motion compensated blocking means (302) moves the block, taken fromthe reference image, by the motion vector and generates the referenceblock which is output. In operation, the exclusive OR block constructingmeans (303) is equivalent to the exclusive OR block constructing means(103). The exclusive OR encoding means (304) is equivalent to theexclusive OR encoding means (104).

As described above, according to the present embodiment, efficientencoding with fewer code bits can be achieved by using the motionestimating means and motion compensated blocking means and applyingmotion compensation to a block for which the generation probabilities ofsymbol 0 and symbol 1 in the exclusive OR block differs widely from theratio of 9:1, in such a manner that the ratio of the generationprobabilities is brought closer to 9:1.

Embodiment A4

FIG. 4 is a block diagram showing the configuration of an image decodingapparatus according to an embodiment of the present invention. Theconfiguration of this embodiment will be described with reference tosame figure.

In the figure, exclusive OR decoding means (401) is a means which takesthe encoded data as an input and decodes it to recover the exclusive ORblock. Motion compensated blocking means 2 (402) is a means which takesa reference image and the motion information as inputs and which, basedon the motion information, divides the input reference image into blockseach consisting of a plurality of pixels. Target block constructingmeans (403) is a means which recovers the target block from theexclusive OR block supplied from the exclusive OR decoding means (401)and a reference block supplied from the motion compensated blockingmeans (402).

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

In operation, the exclusive OR decoding means (401) is equivalent to theexclusive OR decoding means (201). The motion compensated blocking means2 (402) is equivalent to the motion compensated blocking means 2 (302).The target block constructing means (403) is equivalent to the targetblock constructing means (203).

As described above, according to the present embodiment, efficientdecoding with fewer code bits can be achieved by using the motionestimating means and motion compensated blocking means and applyingmotion compensation to a block for which the generation probabilities ofsymbol 0 and symbol 1 in the exclusive OR block differs widely from theratio of 9:1, in such a manner that the ratio of the generationprobabilities is brought closer to 9:1.

Embodiment A5

FIG. 5 is a block diagram showing the configuration of an image encodingapparatus according to an embodiment of the present invention. Theconfiguration of this embodiment will be described below with referenceto same figure.

In the figure, blocking means 1 (501) is a means which takes as an inputa target image to be encoded, and which divides the input image intoblocks each consisting of a plurality of pixels. Blocking means 2 (502)is a means which takes a reference image as an input and divides theinput reference image into blocks each consisting of a plurality ofpixels. Exclusive OR block constructing means (503) is a means whichconstructs an exclusive OR block by scanning a target block taken fromthe image divided by the blocking means 1 (501) and a reference blocktaken from the image divided by the blocking means 2 (502), and byexclusive-ORing pixel values between them. Exclusive OR encoding means(504) is a means which encodes the exclusive OR block and outputs theencoded data. Reference block adoption determining means (505) is ameans which compares the target block with the reference block, andwhich outputs a reference block adoption determining signal forswitching the subsequent processing. Target pixel encoding means (506)is a means which encodes the target block and outputs the encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

In operation, the blocking means 1 (501) is equivalent to the blockingmeans 1 (101). The blocking means 2 (502) is equivalent to the blockingmeans 2 (102). The reference block adoption determining means (505)outputs the reference block adoption determining signal for switchingthe processing, based on the sum of the absolute differences (SAD)between the target block and the reference block, in such a manner thatencoding is performed using the target pixel encoding means (506) if thesum of the absolute differences is larger than or equal to a thresholdvalue, and using the exclusive OR block constructing means (503) andexclusive OR encoding means (504) if the sum of the absolute differencesis less than the threshold value. Here, 5 is used as the thresholdvalue. In operation, the exclusive OR block constructing means (503) isequivalent to the exclusive OR block constructing means (103). Theexclusive OR encoding means (504) is equivalent to the exclusive ORencoding means (104). The target pixel encoding means (506) issubstantially equivalent to the exclusive OR encoding means (504), andis an arithmetic encoder that takes the target block as an input and hasa generation probability model with [0, 0.5) as symbol 0 and [0.5, 1.0)as symbol 1.

As described above, according to the present embodiment, blocks forwhich the generation probabilities of symbol 0 and symbol 1 differswidely from the ratio of 9:1 are regarded as blocks that yield largesums of absolute differences, and the reference block adoptiondetermining means changes the coding scheme to reduce the number ofblocks inefficient in coding, thereby achieving efficient encoding withfewer code bits.

Embodiment A6

FIG. 6 is a block diagram showing the configuration of an image decodingapparatus according to an embodiment of the present invention. Theconfiguration of this embodiment will be described below with referenceto same figure.

In the figure, exclusive OR decoding means (601) is a means which takesthe encoded data as an input and decodes it to recover the exclusive ORblock. Blocking means 2 (602) is a means which takes a reference imageas an input, and which divides the input reference image into referenceblocks each consisting of a plurality of pixels. Target blockconstructing means (603) is a means which takes as inputs the exclusiveOR block recovered by the exclusive OR decoding means (601) and areference block supplied from the blocking means (602), and whichthereby recovers the target block. Reference block adoption controlmeans (604) is a means which switches the subsequent processing inaccordance with the reference block adoption determining signal. Targetpixel decoding means (605) is a means which decodes the encoded data andrecovers the target block.

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

In operation, the exclusive OR decoding means (601) is equivalent to theexclusive OR decoding means (201). The blocking means 2 (602) isequivalent to the blocking means 2 (102).

The target block constructing means (603) is equivalent to the targetblock constructing means (203). The reference block adoption controlmeans (604), based on the reference block adoption determining signal,switches the subsequent processing between the target block constructingmeans (603) and blocking means 2 (602) when using the reference blockand the target pixel decoding means (605) when not using the referenceblock.

The target pixel decoding means (605) is a decoder for arithmeticencoding that has a generation probability model with [0, 0.5) as symbol0 and [0.5, 1.0) as symbol 1, as does the target pixel encoding means(506). The target block is constructed by generating a symbol stringfrom the binary point as the encoded data and the generation probabilitymodel, and by arranging the symbols in the scanning direction.

As described above, according to the present embodiment, blocks forwhich the generation probabilities of symbol 0 and symbol 1 differswidely from the ratio of 9:1 are regarded as blocks that yield largesums of absolute differences, and the reference block adoption controlmeans changes the coding scheme to reduce the number of blocksinefficient in coding, thereby achieving efficient decoding with fewercode bits.

Embodiment A7

FIG. 7 is a block diagram showing the configuration of an image encodingapparatus according to an embodiment of the present invention. Theconfiguration of this embodiment will be described below with referenceto same figure.

In the figure, blocking means 1 (701) is a means which takes as an inputan image to be encoded, and which divides the input image into blockseach consisting of a plurality of pixels.

Blocking means 2 (702) is a means which takes a reference image as aninput and divides the input reference image into blocks each consistingof a plurality of pixels. Statistical model selecting means (703) is ameans which takes as inputs the location of the target pixel to beencoded, a reference block, and a statistical model table hereinafterdescribed, and which selects a statistical model from the statisticalmodel table (704) in accordance with the states of the pixelssurrounding the corresponding location of the target pixel in thereference block, and supplies the selected model to an entropy encodingmeans (705). That is, the statistical model selecting means 703 is ameans that selects a statistical model from among a plurality ofstatistical models, based on the states of the pixels surrounding areference pixel in the reference block that corresponds to the targetpixel in the target block. The entropy encoding means (705) is a meansthat supplies the location of the target pixel to be encoded to thestatistical model selecting means (703), and that entropy-encodes thetarget block based on the statistical model supplied from thestatistical model selecting means (703), and outputs the same as encodeddata.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

In operation, the blocking means 1 (701) is equivalent to the blockingmeans 1 (101). The blocking means 2 (702) is equivalent to the blockingmeans 2 (102).

The statistical model selecting means (703) selects a statistical modelfrom among a plurality of statistical models, and supplies the selectedmodel to the entropy encoding means (705). The statistical model table(2301) is a table in which an index is assigned to each surroundingpixel state and a statistical model is assigned to each index, as shownin FIGS. 23 to 26. Correspondence between the state and index will bedescribed with reference to FIGS. 27 and 28.

Since the states of the pixels surrounding the corresponding pixel areconsidered, first the reference block (2401) is extrapolated to createan extrapolated reference block.

In one method of creation, if the values of the surrounding pixels areobtained from the reference image, these pixels are added to create theextrapolated reference block (2402). In the present embodiment, thismethod is referred to as the extrapolation method 1.

If the values of the surrounding pixels are not obtained from thereference image, the pixels in the outer periphery of the referenceblock are simply extended outside to create the extrapolated referenceblock (2403). This method is referred to as the extrapolation method 2.In like manner, an extrapolated target block is created from the targetblock.

The states of the pixels surrounding the corresponding location of thetarget pixel in the reference block are obtained by applying a referencemask (2503) to the reference block (2501) and a target mask (2504) tothe target block (2502), as shown in FIG. 28. When the pixel values atthe respective locations in the reference mask (2503) and target mask(2504) are denoted by A, B, C, D, E, F, G, H, I, J, K, L, and M, asshown in FIG. 28, index i is expressed by equation A2 below. In FIG. 28,the target pixel to be encoded next is designated by reference numeral2502 a, and the reference pixel corresponding to the target pixel (2502a) is designated by reference numeral 2501 a. In order to also considerthe states of the already encoded pixels in the neighborhood of thetarget pixel (2502 a) in the target block, the statistical modelselecting means (703) of the present embodiment obtains the states ofthe pixels in the neighborhood of the target pixel (2502 a) in the samemanner as described above by using the extrapolated target block. Thisachieves more appropriate selection of the statistical model than whenusing the surrounding pixel states only in the reference block. It is,of course, possible to use the configuration where the surrounding pixelstates only in the reference block are used.

Equation A2

i=B+2D+4E+8F+16H+32K+64M  (2)

At this time, the statistical model corresponding to the index i in thestatistical model table (2301) is selected.

In this way, the statistical model selecting means (703) selects astatistical model from the statistical model table and supplies theselected model to the entropy encoding means (705).

The entropy encoding means (705) uses an arithmetic encoder, as in theexclusive OR encoding means (104), but the arithmetic encoder here usesas the generation probability model the statistical model (704) selectedby the statistical model selecting means (703), and encodes the targetpixel using the selected statistical model.

As described above, according to the present embodiment, the statisticalmodel is changed by the statistical model selecting means in accordancewith the states of the pixels surrounding the corresponding location ofthe target pixel in the reference block; this increases the efficiencyof entropy encoding and achieves efficient encoding with fewer codebits.

Embodiment A8

FIG. 8 is a block diagram showing the configuration of an image decodingapparatus according to an embodiment of the present invention. Theconfiguration of this embodiment will be described below with referenceto same figure.

In the figure, blocking means 2 (802) is a means which takes a referenceimage as an input and divides the input reference image into blocks eachconsisting of a plurality of pixels. Statistical model selecting means(803) is a means which takes as inputs the location of the target pixelto be encoded, a reference block, and the statistical model table, andwhich selects a statistical model from the statistical model table (804)in accordance with the states of the pixels surrounding thecorresponding location of the target pixel in the reference block, andsupplies the selected model to an entropy encoding means (801). Theentropy decoding means (801) is a means that takes the encoded data asan input, and which, based on the statistical model (804), decodes theencoded data and recovers the target block.

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

In operation, the blocking means 2 (802) is equivalent to the blockingmeans 2 (102). The statistical model selecting means (803) is equivalentto the statistical model selecting means (703).

The entropy decoding means (801) uses an arithmetic decoder, as in theexclusive OR decoding means (201), but the arithmetic decoder here usesthe statistical model (804) selected by the statistical model selectingmeans (803). The statistical model table (804) is equivalent to thestatistical model table (704).

As described above, according to the present embodiment, the statisticalmodel is changed by the statistical model selecting means in accordancewith the states of the pixels surrounding the corresponding location ofthe target pixel in the reference block; this increases the efficiencyof entropy coding and,achieves efficient decoding with fewer code bits.

Embodiment A9

FIG. 9 is a block diagram showing the configuration of an image encodingapparatus according to an embodiment of the present invention. Theconfiguration of this embodiment will be described below with referenceto same figure.

In the figure, blocking means 1 (901) is a means which takes as an inputa target image to be encoded and divides the input image into blockseach consisting of a plurality of pixels.

Motion estimating means (906) is a means which searches through areference image for a block that resembles the target block, and whichgenerates a motion vector for the block. Motion compensated blockingmeans 2 (902) is a means which takes the reference image and motioninformation as inputs and which, based on the motion information,divides the input reference image into blocks each consisting of aplurality of pixels. Statistical model selecting means (903) is a meanswhich takes as inputs the location of the target pixel to be encoded, areference block, and a statistical model table, and which selects astatistical model from the statistical model table (904) in accordancewith the states of the pixels surrounding the corresponding location ofthe target pixel in the reference block, and supplies the selected modelto an entropy encoding means (905). The entropy encoding means (905) isa means that entropy-encodes the target block based on the statisticalmodel supplied from the statistical model selecting means (903), andoutputs the same as encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

In operation, the blocking means 1 (901) is equivalent to the blockingmeans 1 (101).

The motion estimating means (906) is equivalent to the motion estimatingmeans (305). The motion compensated blocking means 2 (902) is equivalentto the motion compensated blocking means 2 (302).

The statistical model selecting means (903) is equivalent to thestatistical model selecting means (703). The statistical model table(904) is equivalent to the statistical model table (704). The entropyencoding means (905) is equivalent to the entropy encoding means (705).

As described above, according to the present embodiment, using themotion estimating means and motion compensated blocking means, thestatistical model accuracy is increased, achieving efficient encodingwith fewer code bits.

Embodiment A10

FIG. 10 is a block diagram showing the configuration of an imagedecoding apparatus according to an embodiment of the present invention.The configuration of this embodiment will be described below withreference to same figure.

In the figure, motion compensated blocking means 2 (1002) is a meanswhich takes a reference image and the motion information as inputs andwhich, based on the motion information, divides the input referenceimage into blocks each consisting of a plurality of pixels. Statisticalmodel selecting means (1003) is a means which takes as inputs thelocation of the target pixel to be decoded, a reference block, and astatistical model table, and which selects a statistical model from astatistical model table (1004) in accordance with the states of thepixels surrounding the corresponding location of the target pixel in thereference block, and supplies the selected model to an entropy decodingmeans (1001). The entropy decoding means (1001) is a means that takesthe encoded data as an input and that, based on the statistical model,decodes the encoded data and recovers the target block.

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

In operation, the motion compensated blocking means 2 (1002) isequivalent to the motion compensated blocking means 2 (402). Thestatistical model selecting means (1003) is equivalent to thestatistical model selecting means (803). The entropy decoding means(1001) is equivalent to the entropy decoding means (801). Thestatistical model table (1004) is equivalent to the statistical modeltable (704).

As described above, according to the present embodiment, using themotion compensated blocking means 2, the statistical model accuracy isincreased, achieving efficient decoding with fewer code bits.

Embodiment A11

FIG. 11 is a block diagram showing the configuration of an imageencoding apparatus according to an embodiment of the present invention.The configuration of this embodiment will be described below withreference to same figure.

In the figure, blocking means 1 (1101) is a means which takes as aninput a target image to be encoded and divides the input image intoblocks each consisting of a plurality of pixels.

Blocking means 2 (1102) is a means which takes a reference image as aninput and divides the input reference image into blocks each consistingof a plurality of pixels. Statistical model selecting means (1103) is ameans which takes as inputs the location of the target pixel to beencoded, a reference block, and a statistical model table, and whichselects a statistical model from a statistical model table (1104) inaccordance with the states of the pixels surrounding the correspondinglocation of the target pixel in the reference block, and supplies theselected model to an entropy encoding means (1105). Reference blockadoption determining means (1105) is a means which compares the targetblock with the reference block, and which outputs a reference blockadoption determining signal for switching the subsequent processing. Theentropy encoding means (1106) is a means which entropy-encodes thetarget block based on the statistical model, and outputs the same asencoded data. Target pixel encoding means (1107) is a means whichencodes the target block and outputs the same as encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

In operation, the blocking means 1 (1101) is equivalent to the blockingmeans 1 (101). The blocking means 2 (1102) is equivalent to the blockingmeans 2 (102). The statistical model selecting means (1103) isequivalent to the statistical model selecting means (703). Thestatistical model table (1104) is equivalent to the statistical modeltable (704). The entropy encoding means (1105) is equivalent to theentropy encoding means (705). The reference block adoption determiningmeans (1106) is equivalent to the reference block adoption determiningmeans (505). The target pixel encoding means (1107) is equivalent to thetarget pixel encoding means (506).

As described above, according to the present embodiment, the referenceblock adoption determining means changes the coding scheme for a blockthat does not match the statistical model, thereby reducing the numberof blocks inefficient in encoding and thus achieving efficient encodingwith fewer code bits.

Embodiment A12

FIG. 12 is a block diagram showing the configuration of an imagedecoding apparatus according to an embodiment of the present invention.The configuration of this embodiment will be described below withreference to same figure.

In the figure, blocking means 2 (1202) is a means which takes areference image as an input and divides the input reference image intoblocks each consisting of a plurality of pixels. Statistical modelselecting means (1203) is a means which takes as inputs the location ofthe target pixel to be decoded, a reference block, and a statisticalmodel table, and which selects a statistical model from a statisticalmodel table (1204) in accordance with the states of the pixelssurrounding the corresponding location of the target pixel in thereference block, and supplies the selected model to an entropy decodingmeans (1201). The entropy decoding means (1201) is a means which takesthe encoded data as an input and which, based on the statistical model,decodes the encoded data and recovers the target block. Reference blockadoption control means (1205) is a means which compares the target blockwith the reference block and switches the subsequent processing. Targetpixel decoding means (605) is a means which decodes the encoded data andrecovers the target block.

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

In operation, the entropy decoding means (1201) is equivalent to theentropy decoding means (801). The blocking means 2 (1202) is equivalentto the blocking means 2 (102). The statistical model selecting means(1203) is equivalent to the statistical model selecting means (703). Thestatistical model table (1204) is equivalent to the statistical modeltable (704). The reference block adoption control means (1205) isequivalent to the reference block adoption control means (604). Thetarget pixel decoding means (1206) is equivalent to the target pixeldecoding means (605).

As described above, according to the present embodiment, the referenceblock adoption control means changes the coding scheme for a block thatdoes not match the statistical model, thereby reducing the number ofblocks inefficient in coding and thus achieving efficient decoding withfewer code bits.

Embodiment A13

FIG. 13 is a block diagram showing the configuration of an imageencoding apparatus according to an embodiment of the present invention.The configuration of this embodiment will be described below withreference to same figure.

In the figure, blocking means 1 (1301) is a means which takes as aninput an image to be encoded and divides the input image into blockseach consisting of a plurality of pixels. Blocking means 2 (1302) is ameans which takes a reference image as an input and divides the inputreference image into blocks each consisting of a plurality of pixels.Statistical model estimating means (1303) is a means which estimates astatistical model for a target block from a reference block, and storesthe estimated model in a statistical model (1304). Entropy encodingmeans (1305) is a means which encodes pixels in the target block basedon the statistical model (1304), and outputs the encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

In operation, the blocking means 1 (1301) is equivalent to the blockingmeans 1 (101). The blocking means 2 (1302) is equivalent to the blockingmeans 2 (102). The statistical model estimating means (1303) estimates astatistical model from the reference block. FIG. 29 is a diagram forexplaining how the statistical model is estimated by the statisticalmodel estimating means (1303).

Statistical model estimation begins by obtaining the frequency Z of thesymbol 0. The frequency Z is obtained by counting the number ofoccurrences of the symbol 0 in the reference block and by dividing thenumber by the total number of pixels, 64. The frequency Z is convertedto the generation probability of the symbol 0 by using a conversiongraph (2601). In the conversion graph, r=0.1.

Using the generation probability z obtained from the conversion graph, astatistical model is estimated in which any number in [0, z) is taken asthe symbol 0 and any number in [z, 1.0) as the symbol 1. The estimatedstatistical model is stored in the statistical model (1304).

The entropy encoding means (1305), like the entropy encoding means(102), encodes the target block by using an arithmetic encoder and theestimated statistical model (1304).

As described above, according to the present embodiment, a statisticalmodel for the symbols in the target block is estimated from thereference block by the statistical model estimating means, therebyincreasing the efficiency of entropy encoding and achieving efficientencoding with fewer code bits.

In the present embodiment, a statistical model is generated for eachtarget block, but the configuration is not limited to the illustratedarrangement; for example, a statistical model may be generated for eachtarget pixel.

Embodiment A14

FIG. 14 is a block diagram showing the configuration of an imagedecoding apparatus according to an embodiment of the present invention.The configuration of this embodiment will be described below withreference to same figure.

In the figure, blocking means 2 (1402) is a means which takes areference image as an input and divides the input reference image intoblocks each consisting of a plurality of pixels. Statistical modelestimating means (1403) is a means which estimates a statistical modelfor a target block from a reference block, and stores the estimatedmodel in a statistical model (1404). Entropy decoding means (1401) is ameans which takes the encoded data as an input, and which decodes theencoded data based on the statistical model (1404) and recovers thetarget block.

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

In operation, the blocking means 2 (1402) is equivalent to the blockingmeans 2 (102). The statistical model estimating means (1403) isequivalent to the statistical model estimating means (1303). The entropydecoding means (1401), like the exclusive OR decoding means (201),decodes the encoded data and recovers the target block by using anarithmetic decoder and the statistical model estimated by thestatistical model estimating means (1403).

As described above, according to the present embodiment, a statisticalmodel for the symbols in the target block is estimated from thereference block by the statistical model estimating means, therebyincreasing the efficiency of entropy coding and achieving efficientdecoding with fewer code bits.

Embodiment A15

FIG. 15 is a block diagram showing the configuration of an imageencoding apparatus according to an embodiment of the present invention.The configuration of this embodiment will be described below withreference to same figure.

In the figure, blocking means 1 (1501) is a means which takes as aninput an image to be encoded and divides the input image into blockseach consisting of a plurality of pixels. Motion estimating means (1506)is a means which searches through a reference image for a block thatresembles a target block, and which generates a motion vector for theblock.

Motion compensated blocking means 2 (1502) is a means which takes thereference image and motion information as inputs and which, based on themotion information, divides the input reference image into blocks eachconsisting of a plurality of pixels.

Statistical model estimating means (1503) is a means which estimates astatistical model for a target block from a reference block, and storesthe estimated model in a statistical model (1504).

Entropy encoding means (1505) is a means which encodes pixels in thetarget block based on the statistical model (1504), and outputs theencoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

In operation, the blocking means 1 (1501) is equivalent to the blockingmeans 1 (101). The motion compensated blocking means 2 (1502) isequivalent to the motion compensated blocking means 2 (302). Thestatistical model estimating means (1504) is equivalent to thestatistical model estimating means (1303). The entropy encoding means(1503) is equivalent to the entropy encoding means (1305). The motionestimating means (1506) is equivalent to the motion estimating means(305).

As described above, according to the present embodiment, using themotion estimating means and motion compensated blocking means, theaccuracy of statistical model estimation is increased, thereby achievingefficient encoding with fewer code bits.

Embodiment A16

FIG. 16 is a block diagram showing the configuration of an imagedecoding apparatus according to an embodiment of the present invention.The configuration of this embodiment will be described below withreference to same figure.

In the figure, motion compensated blocking means 2 (1602) is a meanswhich takes a reference image and the motion information as inputs andwhich, based on the motion information, divides the input referenceimage into blocks each consisting of a plurality of pixels. Statisticalmodel estimating means (1603) is a means which estimates a statisticalmodel for a target block from a reference block, and stores theestimated model in a statistical model (1604). Entropy decoding means(1601) is a means which takes the encoded data as an input, and whichdecodes the encoded data based on the statistical model (1604) andrecovers the target block.

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

In operation, the motion compensated blocking means 2 (1602) isequivalent to the motion compensated blocking means 2 (402). Thestatistical model estimating means (1603) is equivalent to thestatistical model estimating means (1303). The entropy decoding means(1601) is equivalent to the entropy decoding means (1401).

As described above, according to the present embodiment, using themotion compensated blocking means 2, the accuracy of statistical modelestimation is increased, thereby achieving efficient decoding with fewercode bits.

Embodiment A17

FIG. 17 is a block diagram showing the configuration of an imageencoding apparatus according to an embodiment of the present invention.The configuration of this embodiment will be described below withreference to same figure.

In the figure, blocking means 1 (1701) is a means which takes as aninput an image to be encoded and divides the input image into blockseach consisting of a plurality of pixels. Blocking means 2 (1702) is ameans which takes a reference image as an input and divides the inputreference image into blocks each consisting of a plurality of pixels.Statistical model estimating means (1703) is a means which estimates astatistical model for a target block from a reference block, and storesthe estimated model in a statistical model (1704). Entropy encodingmeans (1705) is a means which inputs the output data from the blockingmeans 1 (1701), and which encoded the input data based on thestatistical model (1704) and recovers the enclosed data. Reference blockadoption determining means (1706) is a means which compares the targetblock with the reference block and outputs a reference block adoptiondetermining signal for switching the subsequent processing.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below, together with the operationof an image encoding method according to one embodiment of the presentinvention.

In operation, the blocking means 1 (1701) is equivalent to the blockingmeans 1 (101). The blocking means 2 (1702) is equivalent to the blockingmeans 2 (102). The statistical model estimating means (1703) isequivalent to the statistical model estimating means (1303). The entropyencoding means (1705) is equivalent to the entropy encoding means(1305). The reference block adoption determining means (1706) isequivalent to the reference block adoption determining means (505). Thetarget pixel encoding means (1707) is equivalent to the target pixelencoding means (506).

As described above, according to the present embodiment, the referenceblock adoption determining means changes the coding scheme for a blockthat does not match the statistical model, thereby reducing the numberof blocks inefficient in coding and thus achieving efficient encodingwith fewer code bits.

Embodiment A18

FIG. 18 is a block diagram showing the configuration of an imagedecoding apparatus according to an embodiment of the present invention.The configuration of this embodiment of will be described below withreference to same figure.

In the figure, blocking means 2 (1802) is a means which takes areference image as an input and divides the input reference image intoblocks each consisting of a plurality of pixels. Statistical modelestimating means (1803) is a means which estimates a statistical modelfor a target block from a reference block, and stores the estimatedmodel in a statistical model (1804). Entropy decoding means (1801) is ameans which takes the encoded data as an input, and which decodes theencoded data based on the statistical model (1804) and recovers thetarget block. Reference block adoption control means (1805) is a meanswhich switches the subsequent processing in accordance with thereference block adoption determining signal. Target pixel decoding means(1806) is a means which decodes the encoded data and outputs the decodeddata of the target pixel.

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below, together with the operationof an image decoding method according to one embodiment of the presentinvention.

In operation, the blocking means 2 (1802) is equivalent to the blockingmeans 2 (102). The statistical model estimating means (1803) isequivalent to the statistical model estimating means (1303). The entropydecoding means (1801) is equivalent to the entropy decoding means(1401). The reference block adoption control means (1805) is equivalentto the reference block adoption control means (604). The target pixeldecoding means (1806) is equivalent to the target pixel decoding means(605).

As described above, according to the present embodiment, the referenceblock adoption control means changes the coding scheme for a block thatdoes not match the statistical model, thereby reducing the number ofblocks inefficient in coding and thus achieving efficient decoding withfewer code bits.

In any one of the above-described embodiments, a magnetic recordingmedium or an optical recording medium may be created that holds aprogram for having a computer implement the functions of all or part ofthe means so far described so that the program can be run on thecomputer to carry out the above-described operations. In that case also,the same effects as described in connection with the respectiveembodiments can be obtained.

As described above, using the image encoding apparatus, image decodingapparatus, image encoding method, and image decoding method of thepresent invention, more efficient encoding and decoding can be achievedthan when using the prior known binary image encoding and decodingtechniques, for the reasons given below.

(1) In a binary moving image sequence, a target image is predicted froma reference image, and the residual is expressed by exclusive ORs.

(2) Appropriate statistical model is always used by changing thestatistical model in accordance with the states of surrounding pixels inanother frame having correlation.

(3) Appropriate statistical model is used by creating a statisticalmodel from a reference image.

(4) The number of blocks that do not match the statistical model isreduced by using motion compensation or by changing the coding schemeusing a threshold value and a sum of absolute differences.

The reference block adoption determining means of the present inventionhas been described in the fifth embodiment as being applied to theconfiguration shown in FIG. 5, but the applicable configuration is notlimited to the previously described one; for example, the configurationshown in FIG. 30 is also applicable. That is, in the case of the imageencoding apparatus shown in FIG. 30, the reference block adoptiondetermining means 3505 outputs a reference block adoption determiningsignal for switching the subsequent processing, by comparing the numberof code bits of the target block with that of the reference block. Thispoint constitutes a major difference from the configuration of FIG. 5.More specifically, the reference block adoption determining means 3505compares the number of code bits used in the target pixel encoding means506 with the number of code bits used in the exclusive OR encoding means504, and performs switching in such a manner that if the number of codebits from the target pixel encoding means 506 is smaller, the encodeddata from that means is output, and if the number of code bits from theexclusive OR encoding means 504 is smaller, the encoded data from thatmeans is output. Further, when the number of code bits from the targetpixel encoding means 506 is smaller, the reference block adoptiondetermining signal is output. In this way, according to this embodiment,the reference block adoption determining means 3505 switches the outputof the encoded data by reference to the number of code bits, therebyreducing the number of blocks inefficient in coding and thus achievingefficient coding with fewer number of code bits. In FIG. 30, elementsfundamentally the same as those in FIG. 5 are designated by the samereference numerals.

The reference block adoption control means of the present invention hasbeen described in the sixth embodiment as being applied to theconfiguration shown in FIG. 6, but the applicable configuration is notlimited to the previously described one; for example, the configurationshown in FIG. 31 is also applicable. That is, the configuration of theimage decoding apparatus shown in FIG. 31 includes: target pixeldecoding means 605 for recovering the target block by decoding theencoded data output from the image encoding apparatus shown in FIG. 5 or30; and reference block adoption control means 3604 for selecting, basedon the reference block adoption determining signal output from the imageencoding apparatus, the output from the target block constructing means603 or the output from the target pixel decoding means 605 for output asthe target block. This configuration achieves more efficient decodingcompared with the prior art. In FIG. 31, elements fundamentally the sameas those in FIG. 6 are designated by the same reference numerals.

The statistical model selecting means of the present invention has beendescribed in the seventh embodiment as being applied to theconfiguration in which the result of the statistical model selection isnot transmitted to the decoding apparatus, but the applicableconfiguration is not limited to the previously described one; forexample, as shown in FIG. 32, the statistical model selecting means 3703may be configured to output the result of the statistical modelselection as a selection result signal to the decoding apparatus. InFIG. 32, elements fundamentally the same as those in FIG. 7 aredesignated by the same reference numerals.

The image decoding apparatus of the present invention has been describedin the eighth embodiment as having a configuration corresponding to theconfiguration of the image encoding apparatus of the type that does nottransmit the result of the statistical model selection to the decodingapparatus, but the configuration is not limited to the previouslydescribed one; for example, the configuration shown in FIG. 33 is alsoapplicable. That is, the image decoding apparatus shown in FIG. 33comprises: statistical model selecting means 3803 for receiving theselection result signal output from the image encoding apparatus shownin FIG. 32, and for selecting from among a plurality of statisticalmodels a statistical model corresponding to the selection result signal;and entropy decoding means 801 for recovering the target block byentropy-decoding the encoded data output from the image encodingapparatus by using the selected statistical model. This configurationachieves more efficient decoding compared with the prior art. In thisembodiment, blocking means 2 (802) such as shown in FIG. 8 can beeliminated. In FIG. 33, elements fundamentally the same as those in FIG.8 are designated by the same reference numerals.

The reference block adoption determining means of the present inventionhas been described in the 11th embodiment as being applied to theconfiguration shown in FIG. 11, but the applicable configuration is notlimited to the previously described one; for example, the configurationshown in FIG. 34 is also applicable. That is, in the case of the imageencoding apparatus shown in FIG. 34, the reference block adoptiondetermining means 3106 outputs a reference block adoption determiningsignal for switching the subsequent processing, by comparing the numberof code bits of the target block with that of the reference block. Thispoint constitutes a major difference from the configuration of FIG. 11.More specifically, the reference block adoption determining means 3106compares the number of code bits used in the target pixel encoding means1107 with the number of code bits used in the entropy encoding means1105, and performs switching in such a manner that if the number of codebits from the target pixel encoding means 1107 is smaller, the encodeddata from that means is output, and if the number of code bits from theentropy encoding means 1105 is smaller, the encoded data from that meansis output. Further, when the number of code bits from the target pixelencoding means 1107 is smaller, the reference block adoption determiningsignal is output. In this way, according to this embodiment, thereference block adoption determining means 3106 switches the output ofthe encoded data by reference to the number of code bits, therebyreducing the number of blocks inefficient in coding and thus achievingefficient encoding with fewer number of code bits. In FIG. 34, elementsfundamentally the same as those in FIG. 11 are designated by the samereference numerals.

The reference block adoption control means of the present invention hasbeen described in the 12th embodiment as being applied to theconfiguration shown in FIG. 12, but the applicable configuration is notlimited to the previously described one; for example, the configurationshown in FIG. 35 is also applicable. That is, the configuration of theimage decoding apparatus shown in FIG. 35 includes: target pixeldecoding means 1206 for recovering the target block by decoding theencoded data output from the image encoding apparatus shown in FIG. 11or 34; and reference block adoption control means 3205 for selecting,based on the reference block adoption determining signal output from theimage encoding apparatus, the output from the entropy decoding means1201 or the output from the target pixel decoding means 1206 for outputas the target block. This configuration achieves more efficient decodingcompared with the prior art. In FIG. 35, elements fundamentally the sameas those in FIG. 12 are designated by the same reference numerals.

Each of the above embodiments has been described for the case in whichthe (t+1)th frame of a moving image sequence is used as the targetbinary image and the t-th frame as the reference binary image, but theembodiments are not restricted to the illustrated case; for example, thesame subject may be photographed by a stereocamera pair, and an imagecaptured by one camera and an image captured by the other camera at thesame time may be used as the target binary image and reference binaryimage, respectively. In this case also, the same effects as described inconnection with the respective embodiments can be obtained.

As is apparent from the above description, the present invention offersthe advantage of being able to achieve more efficient encoding anddecoding than when using the prior art binary image coding techniques.

Further embodiments of the present invention will be described belowwith reference to drawings.

Embodiment B1

FIG. 36 is a block diagram showing the configuration of an imageencoding apparatus according to a B1st embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure.

In the figure, dynamic range estimating means (10101) is a means whichtakes a target multi-value image as an input, extracts the pixel valueof the largest area and the pixel value of the second largest area inthe multi-value image, and outputs the pixel values as a dynamic range.

Smoothing function estimating means (10102) is a means which takes themulti-value image and dynamic range as inputs, and which estimates asmoothing function by analyzing luminance gradients in the multi-valueimage.

Multi-value to binary converting means (10103) is a means which performsluminance conversion using the dynamic range, and which generates abinary image from the multi-value image by using a threshold value as amulti-value to binary conversion criterion which is predetermined sothat the original multi-value image could be well approximated ifsmoothing were done at the corresponding decoder side using the samesmoothing function as mentioned above. Thresholding using this thresholdvalue will be described in detail in the operational descriptionhereinafter given. The smoothing function estimated by the smoothingfunction estimating means 10102 based on the multi-value image is afunction so adjusted that the original multi-value image could, ineffect or in approximation fashion, be reproduced if the smoothingfunction were applied to the corresponding binary image at thecorresponding decoder side.

Dynamic range encoding means (10105) is a means which encodes thedynamic range and outputs the encoded data.

Binary image encoding means (10104) is a means which encodes the binaryimage and outputs the encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below with reference to FIGS. 36 to44, together with the operation of an image encoding method according toone embodiment of the present invention.

FIG. 37 is a diagram showing the target multi-value image. FIG. 38 is adistribution diagram of pixel values along line A-B in FIG. 37. As shownin FIG. 37, the pixel value of black is 255 and the pixel value of whiteis 0.

The dynamic range estimating means (10101) extracts the pixel value ofthe largest area and the pixel value of the second largest area in themulti-value image; in many multi-value images, these pixel valuescoincide with the largest pixel value and the smallest pixel value,respectively, so that in the present embodiment, the largest pixel valueDmax and the smallest pixel value Dmin are extracted by scanning thetarget multi-value image.

The smoothing function estimating means (10102) is shown in FIG. 39.

As shown in the figure, in x-direction filtering (10301), an x-directionfilter (10401) is applied and scanned over the image to detect thegradient along the x-direction in the image.

In y-direction filtering (10302), a y-direction filter (10402) isapplied and scanned over the image to detect the gradient along they-direction in the image.

In gradient detection (10303), gradient d (i, j) is detected bycalculating the following equation B1 using the x-direction gradient dx(i, j) obtained by the x-direction filtering (10301) and the y-directiongradient dy (i, j) obtained by the y-direction filtering (10302), where(i, j) are the coordinates on the image.

Equation B1

d(i,j)={square root over (d×(i,j)² +dy(i,j)²)}  (1)

In gradient direction detection (10304), gradient direction θ (i, j) isdetected by calculating the following equation B2 using the x-directiongradient dx (i, j) obtained by the x-direction filtering (10301) and they-direction gradient dy (i, j) obtained by the y-direction filtering(10302), where (i, j) are the coordinates on the image.

Equation B2 $\begin{matrix}{\theta = {\tan^{- 1}\frac{y}{x}}} & (2)\end{matrix}$

In non-maximum value suppression (10305), using a window that changeswith θ, as shown in FIG. 40, an image is created in such a manner thatif the value of the gradient at reference point within the window is amaximum value, the image portion at the coordinates of the referencepoint is assigned a value of 1; otherwise, the image portion at thecoordinates of the reference point is assigned a value of 0.

In average gradient detection (10306), average gradient d'ave isobtained by calculating the average of the gradients detected in thegradient detection (10303) for the pixels of value 1 in the binary imageobtained by the non-maximum value suppression (10305). Further, usingthe maximum pixel value Dmax and minimum pixel value Dmin detected bythe dynamic range estimating means (10101), normalized average gradientis recalculated from equation B3 below to obtain dave.

Equation B3 $\begin{matrix}{d_{ave} = {\frac{255}{{D\quad \max} - {D\quad \min}}d_{ave}^{\prime}}} & (3)\end{matrix}$

Smoothing function selecting means (10307) selects a smoothing filter inaccordance with the average gradient dave, as shown in FIG. 41. Thedetail of the smoothing filter 1 in FIG. 41 is shown in FIG. 42. In FIG.42, the encircled position shows the location of the pixel to besubjected to smoothing. While scanning the image, the result of theconvolution with the filter 1 (10601), the result of the convolutionwith the filter 2 (10602), the result of the convolution with the filter3 (10603), and the result of the convolution with the filter 4 (10604)are respectively calculated, and the smallest value of the four filtersis taken as the result of the smoothing filter 1. In FIG. 42, a, b, c,d, e, f, g, and h are each 0.5. The smoothing filter 2 is a filter thatapplies the smoothing filter 1 after applying the smoothing filter 1.

The smoothing filter 3 is a filter that applies the smoothing filter 1after applying the smoothing filter 2. When dave is greater than 191,smoothing by the smoothing filter will not be applied, since thegradient of the image is considered to represent a step edge. On theother hand, when dave is smaller than 10, smoothing by the smoothingfilter will not be applied, since it is considered that there is noimage gradient.

The multi-value to binary converting means (10103) converts themulti-value image to a binary image having only two pixel values, 255and 0, by considering the characteristic of the smoothing functionestimated by the smoothing function estimating means (10102). Theresponses to one-dimensional steps of the smoothing filter 1, smoothingfilter 2, and smoothing filter 3 are as shown in FIG. 43; accordingly,the multi-value to binary conversion corresponding to the smoothingfilter 1, smoothing filter 2, and smoothing filter 3 is the thresholdingsuch as shown in FIG. 44. Therefore, the multi-value to binaryconverting means (10103) applies the thresholding shown in FIG. 44 tothe multi-value image.

The binary image encoding means (10104) encodes the binary image byusing the binary image encoding scheme MMR, defined in CCITT'sinternational standard traditionally used for facsimile systems, etc.,and outputs the encoded data.

The smoothing function encoding means (10106) encodes the smoothingfunction estimated by the smoothing function estimating means (10102),and outputs the encoded data. In the present embodiment, since thesmoothing function is selected from among the three smoothing functions,the identification number of the selected smoothing function is encodedwhich is output as the encoded data.

The dynamic range encoding means (10105) individually encodes the Dmaxand Dmin obtained by the dynamic range estimating means (10101), andoutputs the encoded data.

As described above, in the present embodiment, by utilizing the propertyof a multi-value image that almost all pixels in the image have auniform minimum value or maximum value with intermediate valuesdistributed along the boundary, the state of the distribution of theintermediate values is analyzed, the smoothing function that provides agood approximation of the intermediate value distribution is estimated,and a binary base image corresponding to the estimated smoothingfunction is estimated. By individually encoding the estimated maximumpixel value and minimum pixel value, the estimated smoothing function,and the estimated binary base image and outputting the results asencoded data, efficient encoding can be achieved.

Embodiment B2

FIG. 45 is a block diagram showing the configuration of an imagedecoding apparatus according to a B2nd embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure.

In the figure, binary image decoding means (10901) is a means forrecovering the binary image by decoding the binary image encoded data.

Smoothing function decoding means (10902) is a means for recovering thesmoothing function by decoding the smoothing function encoded data.

Dynamic range decoding means (10903) is a means for recovering thedynamic range by decoding the dynamic range encoded data.

Binary to multi-value converting means (10904) is a means for recoveringthe multi-value image by smoothing the binary image using the smoothingfunction recovered by the smoothing function decoding means (10902), andby performing luminance conversion using the dynamic range recovered bythe dynamic range decoding means (10903).

Binary mask applying means (10905) is a means for obtaining a newmulti-value image by applying masking to the multi-value image with thebinary image recovered by the binary image decoding means (10901).

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below.

The binary image decoding means (10901) recovers the binary image havingonly two pixel values, 0 and 255, by decoding the binary image encodeddata which was encoded using the binary image encoding scheme MMRdefined in CCITT's international standard traditionally used forfacsimile systems, etc.

The smoothing function decoding means (10902) recovers the smoothingfunction by decoding the smoothing function encoded data.

The dynamic range decoding means (10903) recovers the maximum pixelvalue Dmax and minimum pixel value Dmin by decoding the dynamic rangeencoded data.

The binary to multi-value converting means (10904) actually applies thesmoothing filter recovered by the smoothing function decoding means(10902). (For the method of applying the smoothing filter, refer to thedescription of the smoothing function selecting means (10307) and FIG.42.) Further, using the maximum pixel value Dmax and minimum pixel valueDmin recovered by the dynamic range decoding means (10903), a linearconversion is performed as shown in FIG. 46, to recover the multi-valueimage. In the binary mask applying means (10905), using the binary imagerecovered by the binary image decoding means (10901), the values of thepixels in the multi-value image that correspond to the pixels of value 0in the binary image are forcefully changed to Dmin so that the pixels inthe encoded multi-value image that have a minimum pixel value do nottake any other value than the minimum pixel value. The binary maskapplying means (10905) is effective particularly when there is a need torestrict the position of Dmin to maintain matching with texture data,but can be omitted if there is no such need.

As described above, in the present embodiment, by utilizing the propertyof a multi-value image that almost all pixels in the image have auniform minimum value or maximum value with intermediate valuesdistributed along the boundary, the state of the distribution of theintermediate values is analyzed, the smoothing function that provides agood approximation of the intermediate value distribution is estimated,and a binary base image corresponding to the estimated smoothingfunction is estimated. By individually encoding and outputting theestimated maximum pixel value and minimum pixel value, the estimatedsmoothing function, and the estimated binary base image, and by decodingthe encoded data thus output, efficient decoding with fewer code bitscan be achieved.

Embodiment B3

FIG. 47 is a block diagram showing the configuration of an imageencoding apparatus according to a B3rd embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure.

In the figure, dynamic range estimating means (11101) is a means whichtakes a target multi-value image as an input, and which extracts thepixel value of the largest area and the pixel value of the secondlargest area in the multi-value image.

Smoothing function estimating means (11102) is a means which takes themulti-value image and dynamic range as inputs, and which estimates asmoothing function by analyzing luminance gradients in the multi-valueimage.

Multi-value to binary converting means (11103) is a means whichgenerates a binary image by using the dynamic range, smoothing function,and multi-value image so that the multi-value image can be wellapproximated when luminance conversion is performed using the dynamicrange and smoothing is done using the smoothing function.

Dynamic range encoding means (11105) is a means which encodes thedynamic range and outputs the encoded data.

Smoothing function encoding means (11106) is a means which encodes thesmoothing function and outputs the encoded data.

Binary image encoding means (11104) is a means which encodes the binaryimage and outputs the encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below.

The dynamic range estimating means (11101) extracts the pixel value ofthe largest area and the pixel value of the second largest area in themulti-value image; in many multi-value images, these pixel valuescoincide with the largest pixel value and the smallest pixel value,respectively, so that in the present embodiment, the largest pixel valueDmax and the smallest pixel value Dmin are extracted by scanning thetarget multi-value image.

The smoothing function estimating means (11102) is shown in FIG. 48.

In x-direction filtering (11201), an x-direction filter (10401) isapplied and scanned over the image to detect the gradient along thex-direction in the image. In y-direction filtering (11202), ay-direction filter (10402) is applied and scanned over the image todetect the gradient along the y-direction in the image.

In gradient detection (11203), gradient d (i, j) is detected bycalculating equation B1 using the x-direction gradient dx (i, j)obtained by the x-direction filtering (11201) and the y-directiongradient dy (i, j) obtained by the y-direction filtering (11202), where(i, j) are the coordinates on the image.

In gradient direction detection (11204), gradient direction θ (i, j) isdetected by calculating equation B2 using the x-direction gradient dx(i, j) obtained by the x-direction filtering (11201) and the y-directiongradient dy (i, j) obtained by the y-direction filtering (11202), where(i, j) are the coordinates on the image.

In non-maximum value suppression (11205), using a window that changeswith θ, as shown in FIG. 40, an image is created in such a manner thatif the value of the gradient at reference point within the window is amaximum value, the image portion at the coordinates of the referencepoint is assigned a value of 1; otherwise, the image portion at thecoordinates of the reference point is assigned a value of 0.

In average gradient detection (11206), average gradient d'ave isobtained by calculating the average of the gradients detected in thegradient detection (11203) for the pixels of value 1 in the binary imageobtained by the non-maximum value suppression (11205). Further, usingthe maximum pixel value Dmax and minimum pixel value Dmin detected bythe dynamic range estimating means (11101), normalized average gradientis recalculated from equation B3 to obtain dave.

In smoothing function construction (11207), a smoothing filter isconstructed in accordance with the normalized average gradient dave, asshown in FIG. 49. The number of steps of the constructed smoothingfilter is varied according to the gradient, as shown in FIG. 49. Thedetail of the smoothing filter of FIG. 49 is shown in FIG. 50. In thefigure, the smoothing filter step 2, smoothing filter step 3, andsmoothing filter step 4 are designated by 11401, 11402, and 11403,respectively. Smoothing filter coefficient table 11404 is also shown inthe figure. When dave is greater than 191, smoothing by the smoothingfilter will not be applied, since the gradient of the image isconsidered to represent a step edge. On the other hand, when dave issmaller than 10, smoothing by the smoothing filter will not be applied,since it is considered that there is no image gradient.

The multi-value to binary converting means (11103) converts themulti-value image to a binary image having only two pixel values, 255and 0, by considering the characteristic of the smoothing functionestimated by the smoothing function estimating means (11102). Theresponses to one-dimensional steps of the smoothing filter step 2,smoothing filter step 3, and smoothing filter step 4 are as shown inFIG. 51; accordingly, the multi-value to binary conversion correspondingto the smoothing filter step 2 (11401), smoothing filter step 3 (11402),and smoothing filter step 4 (11403) involves the thresholding shown inFIG. 44 followed by morphological processing with a morphological filtersuch as shown in FIG. 52. That is, the processing is such that when thesmoothing filter step 2 is constructed, the reference point is replacedby the smallest value within the filter window by using themorphological filter 1 (11601); when the smoothing filter step 3 (11603)is constructed, the reference point is replaced by the smallest valuewithin the filter window by using the morphological filter 2 (11602);and when the smoothing filter step 4 is constructed, the reference pointis replaced by the smallest value within the filter window by using themorphological filter 3.

Therefore, the multi-value to binary converting means (11103) appliesthe morphological processing to the multi-value image by using thesmoothing filter constructed as shown in FIG. 52, after performing thethresholding shown in FIG. 44.

The binary image encoding means (11104) encodes the binary image byusing the binary image encoding scheme MMR defined in CCITT'sinternational standard traditionally used for facsimile systems, etc.,and outputs the encoded data.

The smoothing function encoding means (11106) encodes the smoothingfunction estimated by the smoothing function estimating means (11102),and outputs the encoded data.

The dynamic range encoding means (11105) encodes the Dmax and Dminobtained by the dynamic range estimating means (11101), and outputs theencoded data.

As described above, in the present embodiment, by utilizing the propertyof a multi-value image that almost all pixels in the image have auniform minimum value or maximum value with intermediate valuesdistributed along the boundary, the state of the distribution of theintermediate values is analyzed, the smoothing function that provides agood approximation of the intermediate value distribution is estimated,and a binary base image corresponding to the estimated smoothingfunction is estimated. By individually encoding the estimated maximumpixel value and minimum pixel value, the estimated smoothing function,and the estimated binary base image and outputting the results asencoded data, efficient encoding can be achieved.

Embodiment B4

FIG. 53 is a block diagram showing the configuration of an imagedecoding apparatus according to a B4th embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure.

In the figure, binary image decoding means (11701) is a means forrecovering the binary image by decoding the binary image encoded data.

Smoothing function decoding means (11702) is a means for recovering thesmoothing function by decoding the smoothing function encoded data.

Dynamic range decoding means (11703) is a means for recovering thedynamic range by decoding the dynamic range encoded data.

Binary to multi-value converting means (11704) is a means for recoveringthe multi-value image by smoothing the binary image using the smoothingfunction recovered by the smoothing function decoding means (11702), andby performing luminance conversion using the dynamic range recovered bythe dynamic range decoding means (11703).

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below.

The binary image decoding means (11701) recovers the binary image havingonly two pixel values, 0 and 255, by decoding the binary image encodeddata which was encoded using the binary image encoding scheme MMRdefined in CCITT's international standard traditionally used forfacsimile systems, etc.

The smoothing function decoding means (11702) recovers the smoothingfunction by decoding the smoothing function encoded data.

The dynamic range decoding means (11703) recovers the maximum pixelvalue Dmax and minimum pixel value Dmin by decoding the dynamic rangeencoded data. The binary to multi-value converting means (11704)actually applies the smoothing filter recovered by the smoothingfunction decoding means (11702). (For the method of applying thesmoothing filter, refer to the description of the smoothing functionconstructing means (11207) and FIG. 50.) Further, using the maximumpixel value Dmax and minimum pixel value Dmin recovered by the dynamicrange decoding means (10903), a linear conversion is performed as shownin FIG. 46, to recover the multi-value image.

As described above, in the present embodiment, by utilizing the propertyof a multi-value image that almost all pixels in the image have auniform maximum value or minimum value with intermediate valuesdistributed along the boundary, the state of the distribution of theintermediate values is analyzed, the smoothing function that provides agood approximation of the intermediate value distribution is estimated,and a binary base image corresponding to the estimated smoothingfunction is estimated. By individually encoding and outputting theestimated maximum pixel value and minimum pixel value, the estimatedsmoothing function, and the estimated binary base image, and by decodingthe encoded data thus output, efficient decoding with fewer code bitscan be achieved.

Embodiment B5

FIG. 54 is a block diagram showing the configuration of an imageencoding apparatus according to a B5th embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure.

In the figure, dynamic range estimating means (11801) is a means whichtakes a target multi-value image as an input, and which extracts thepixel value of the largest area and the pixel value of the secondlargest area in the multi-value image.

Smoothing function estimating means (11802) is a means which takes themulti-value image and dynamic range as inputs, and which estimates asmoothing function by analyzing luminance gradients in the multi-valueimage. Multi-value to binary converting means (11803) is a means whichgenerates a binary image by using the dynamic range, smoothing function,and multi-value image so that the multi-value image can be wellapproximated when luminance conversion is performed using the dynamicrange and smoothing is done using the smoothing function.

Dynamic range encoding means (11805) is a means which encodes thedynamic range and outputs the encoded data.

Smoothing function coefficient encoding means (11806) is a means whichencodes the smoothing function and outputs the encoded data. Binaryimage encoding means (11804) is a means which encodes the binary imageand outputs the encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below.

The dynamic range estimating means (11801) extracts the pixel value ofthe largest area and the pixel value of the second largest area in themulti-value image; in many multi-value images, these pixel valuescoincide with the largest pixel value and the smallest pixel value,respectively, so that in the present embodiment, the largest pixel valueDmax and the smallest pixel value Dmin are extracted by scanning thetarget multi-value image.

The smoothing function estimating means (11802) is shown in FIG. 55. Inx-direction filtering (11901), an x-direction filter (10401) is appliedand scanned over the image to detect the gradient along the x-directionin the image.

In y-direction filtering (11902), a y-direction filter (10402) isapplied and scanned over the image to detect the gradient along they-direction in the image. In gradient detection (11903), gradient d (i,j) is detected by calculating equation B1 using the x-direction gradientdx (i, j) obtained by the x-direction filtering (11901) and they-direction gradient dy (i, j) obtained by the y-direction filtering(11902), where (i, j) are the coordinates on the image.

In gradient direction detection (11904), gradient direction θ (i, j) isdetected by calculating equation B2 using the x-direction gradient dx(i, j) obtained by the x-direction filtering (11901) and the y-directiongradient dy (i, j) obtained by the y-direction filtering (11902), where(i, j) are the coordinates on the image. In non-maximum valuesuppression (11905), using a window that changes with θ, as shown inFIG. 40, an image is created in such a manner that if the value of thegradient at reference point within the window is a maximum value, theimage portion at the coordinates of the reference point is assigned avalue of 1; otherwise, the image portion at the coordinates of thereference point is assigned a value of 0.

In direction-by-direction average gradient detection (11906), averagegradient is obtained for each of two directions, i.e., the horizontaland vertical directions, based on the gradient direction detected in thegradient detection (11904), by calculating the average of the gradientsdetected in the gradient detection (11903) for the pixels of value 1 inthe binary image obtained by the non-maximum value suppression (11905).Further, using the maximum pixel value Dmax and minimum pixel value Dmindetected by the dynamic range estimating means (11901), normalizedaverage gradient is recalculated from equation B3 to obtain the averagegradient, dave_1, in the vertical direction and the average gradient,dave_2, in the horizontal direction.

In smoothing function generation (11907), a smoothing filter isgenerated by estimating smoothing filter coefficients based on theaverage gradients dave_1 and dave_2. In the present embodiment, thecoefficients of the smoothing filter of step number 3 shown in FIG. 56are estimated. Here, constraints are applied by equation B4, butdepending on the image, each coefficient may be weighted.

Equation B4

a=1  (4)

b=f,c=h  (5)

$\begin{matrix}{g = {i = {e = {d = \frac{h + f}{2}}}}} & (6)\end{matrix}$

 j=a+b+c+d+e+f+g+h+i  (7)

Using dave_1, c is estimated by equation B5. However, when dave_1 isgreater than 200, the gradient of the image is considered to represent astep edge, so that c is set to 0. On the other hand, when dave_1 issmaller than 50, it is considered that there is no image gradient, sothat c is set to 0.

Equation B5 $\begin{matrix}{c = \frac{255 - d_{ave1}}{2d_{ave1}}} & (8)\end{matrix}$

Using dave_2, b is estimated by equation B6. However, when dave_2 isgreater than 200, the gradient of the image is considered to represent astep edge, so that b is set to 0. On the other hand, when dave_2 issmaller than 50, it is considered that there is no image gradient, sothat b is set to 0.

Equation B6 $\begin{matrix}{b = \frac{255 - d_{ave2}}{2d_{ave2}}} & (9)\end{matrix}$

Filter coefficients and scales are estimated using equations B4, B5, andB6, as described above. The multi-value to binary converting means(11903) converts the multi-value image to a binary image having only twopixel values, 255 and 0, by considering the characteristic of thesmoothing function estimated by the smoothing function estimating means(11902). In this embodiment, the threshold value is estimated based onthe filter coefficients, and the binary image is obtained bythresholding the multi-value image using the estimated threshold value.The threshold value y is estimated by equation B7.

Equation B7 $\begin{matrix}{\gamma = {255\left( {\frac{a + {2b}}{4j} + \frac{a + {2h}}{4j}} \right)}} & (10)\end{matrix}$

The binary image encoding means (11804) encodes the binary image byusing the binary image encoding scheme MMR defined in CCITT'sinternational standard traditionally used for facsimile systems, etc.,and outputs the encoded data.

The smoothing function coefficient encoding means (11806) encodes eachcoefficient and scale of the smoothing function estimated by thesmoothing function estimating means (11802), and outputs the encodeddata. The dynamic range encoding means (11805) individually encodes theDmax and Dmin obtained by the dynamic range estimating means (11801),and outputs the encoded data.

As described above, in the present embodiment, by utilizing the propertyof a multi-value image that almost all pixels in the image have auniform maximum value or minimum value with intermediate valuesdistributed along the boundary, the state of the distribution of theintermediate values is analyzed, the smoothing function that provides agood approximation of the intermediate value distribution is estimated,and a binary base image corresponding to the estimated smoothingfunction is estimated. By individually encoding the estimated maximumpixel value and minimum pixel value, the estimated smoothing function,and the estimated binary base image and outputting the results asencoded data, efficient encoding can be achieved.

Embodiment B6

FIG. 57 is a block diagram showing the configuration of an imagedecoding apparatus according to a B6th embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure.

In the figure, binary image decoding means (12101) is a means forrecovering the binary image by decoding the binary image encoded data.

Smoothing function coefficient decoding means (12102) is a means forrecovering the smoothing function by decoding the smoothing functionencoded data.

Dynamic range decoding means (12103) is a means for recovering thedynamic range by decoding the dynamic range encoded data.

Binary to multi-value converting means (12104) is a means for recoveringthe multi-value image by smoothing the binary image using the smoothingfunction recovered by the smoothing function decoding means (12102), andby performing luminance conversion using the dynamic range recovered bythe dynamic range decoding means (12103).

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below.

The binary image decoding means (12101) recovers the binary image havingonly two pixel values, 0 and 255, by decoding the binary image encodeddata which was encoded using the binary image encoding scheme MMRdefined in CCITT's international standard traditionally used forfacsimile systems, etc.

The smoothing function coefficient decoding means (12102) recovers thesmoothing filter coefficients and scales and thus the smoothing functionby decoding the smoothing function encoded data. The dynamic rangedecoding means (12103) recovers the maximum pixel value Dmax and minimumpixel value Dmin by decoding the dynamic range encoded data.

The binary to multi-value converting means (12104) applies convolutionwith the smoothing filter recovered by the smoothing functioncoefficient decoding means (12102). Further, using the maximum pixelvalue Dmax and minimum pixel value Dmin recovered by the dynamic rangedecoding means (12103), a linear conversion is performed as shown inFIG. 46, to recover the multi-value image.

As described above, in the present embodiment, by utilizing the propertyof a multi-value image that almost all pixels in the image have auniform maximum value or minimum value with intermediate valuesdistributed along the boundary, the state of the distribution of theintermediate values is analyzed, the smoothing function that provides agood approximation of the intermediate value distribution is estimated,and a binary base image corresponding to the estimated smoothingfunction is estimated. By individually encoding and outputting theestimated maximum pixel value and minimum pixel value, the estimatedsmoothing function, and the estimated binary base image, and by decodingthe encoded data thus output, efficient decoding with fewer code bitscan be achieved.

Embodiment B7

FIG. 58 is a block diagram showing the configuration of an imageencoding apparatus according to a B7th embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure.

In the figure, multi-value to binary converting means (12201) is a meanswhich takes a target image (with a range of values from 0 to 255, eachbeing an integer) as an input, and which binarizes the input targetimage by assigning a value of 0 to pixels of value 0 and a value of 255to pixels of other values.

Binary image encoding means (12202) is a means which encodes the binaryimage having values of {0, 255} and outputs the encoded data. Smoothingfunction estimating means (12203) is means for determining a smoothingfunction. Smoothing function encoding means (12204) is a means forencoding the thus determined function. Here, the smoothing functionestimating means (12203) corresponds to the smoothing functiongenerating means of the present invention.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below.

The binary image binarized by the multi-value to binary converting means(12201) is encoded by the binary image encoding means (12202). For theencoding, the binary image encoding scheme MMR defined in CCITT'sinternational standard is used, with value 0 as white and 255 as black.

On the other hand, the binarized image is compared by the smoothingfunction estimating means (12203) with the input multi-value image todetermine the smoothing function. This will be explained below withreference to FIGS. 60 and 61.

As noted in the description of the background art, many alpha planeshave the property that most portions are uniform and intermediate valuesare distributed along the boundary. To reproduce the intermediate valuesdistributed along the boundary, consider the smoothing operation whereinsubstitution is made for the center pixel value x, depending on whetherthe values of the vertically (b3, b0) and horizontally (b2, b1)neighboring pixels are 255 or not.

Since the target multi-value image is binarized by assigning 0 to pixelsof value 0 and 255 to pixels of other values, the substitution isperformed only when the value of the target pixel is 255. Therefore, thebinarization pattern of the four neighbors of a pixel taking the valueof 255 is expressed by four bits (16 patterns).

The smoothing function estimating means (12203) scan the image andobtains the value to substitute by finding the average value for each ofthe 16 patterns of the four neighboring pixels of a pixel taking thevalue of 255. An example is shown in Table 1.

TABLE 1 b3 b2 b1 b0 x ≠ 255 ≠255 ≠ 255 ≠ 255 32 ≠255 ≠255 ≠ 255 =255 64≠255 ≠ 255 =255 ≠255 64 ≠ 255 ≠255 =255 =255 128 ≠255 =255 ≠255 ≠255 64≠ 255 =255 ≠ 255 =255 128 ≠255 =255 =255 ≠ 255 128 ≠255 =255 =255 =255192 ≠255 ≠ 255 ≠255 ≠255 64 =255 ≠255 ≠255 =255 128 =255 ≠ 255 =255 ≠255128 =255 ≠255 =255 =255 192 =255 =255 ≠ 255 ≠ 255 128 =255 =255 ≠255=255 192 =255 =255 =255 ≠255 192 =255 =255 =255 =255 255

Accordingly, in the case of a pixel at the boundary where the valuechanges from 0 to 255, as shown in the first stage of smoothing in FIG.61, for example, 128 is substituted for the pixel value. If there aretwo or more pixels with intermediate values at or near the contour, theoperation for finding the average value for each of the 16 patterns ofthe four neighboring pixels is repeated in a recursive manner for thepixels having the value of 255. Table 2 shows the results of this secondoperation. In this way, a boundary having an intermediate valuecorresponding to the second stage of smoothing in FIG. 61 can beexpressed.

TABLE 2 b3 b2 b1 b0 x ≠255 ≠255 ≠255 ≠255 128 ≠255 ≠255 ≠255 =255 128≠255 ≠255 =255 ≠255 128 ≠255 ≠255 =255 =255 192 ≠255 =255 ≠255 ≠255 128≠255 =255 ≠255 =255 192 ≠255 =255 =255 ≠255 192 ≠255 =255 =255 =255 192=255 ≠255 ≠255 ≠255 128 =255 ≠255 ≠255 =255 192 =255 ≠255 =255 ≠255 192=255 ≠255 =255 =255 192 =255 =255 ≠255 ≠255 192 =255 =255 ≠255 =255 192=255 =255 =255 ≠255 192 =255 =255 =255 =255 255

The output of the smoothing function estimating means (12203) isobtained as the number of stages of smoothing (in the illustratedexample, 2 stages, the maximum possible number being 8 stages) and pixelvalue tables for the patterns of (b3, b2, b1, b0) corresponding to thenumber of stages. Here, the number of stages refers to the number ofrepetitions of the smoothing operation which is repeated in a recursivemanner. The smoothing function encoding means (12204) encodes the numberof stages of smoothing as three bits and the pixel value tables for thepatterns of (b3, b2, b1, b0) as 8 bits×15 (the number of patternsexcluding the pattern in which all pixel values are 255)×number ofstages.

Embodiment B8

FIG. 59 is a block diagram showing the configuration of an imagedecoding apparatus according to a B8th embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure. Outputs from the image encoding apparatusof the seventh embodiment are supplied as inputs to the decodingapparatus of the present embodiment. Binary image decoding means (12301)is a means which takes the output of the binary image encoding means(12202) as an input and recovers the binary image of {0, 255} from thebinary image encoded data. Smoothing function decoding means (12302) isa decoding means for decoding the output of the smoothing functionencoding means (12204). Binary to multi-value converting means (12303)is a means which takes the smoothing function and binary image as inputsand reconstructs the multi-value image.

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below.

The binary image decoding means (12301) uses the MMR decoding scheme.The smoothing function decoding means decodes the number of stages ofsmoothing and the substitution pixel value tables for the patternscorresponding to the number of stages. The decoded tables are assumed tobe the two tables, Table 1 and Table 2, used in the example of the imageencoding apparatus. The binary to multi-value converting means (12303)performs conversion on each pixel of value 255 to converts its value intwo stages using Tables 1 and 2 by reference to its four neighboringpixels, as shown in FIG. 61.

As described above, in the seventh and eighth embodiments, by utilizingthe property of a multi-value image that almost all pixels in the imagehave uniform binary values with intermediate values distributed alongthe boundary, the state of the distribution of the intermediate valuesis analyzed, and the smoothing function that provides a goodapproximation of the intermediate value distribution is estimated. Sincethis smoothing function is expressed by multiple stages, even if theintermediate value has a width greater than or equal to two pixels, anysmoothing pattern can be expressed for up to eight pixels. Any smoothingpattern here means the rising/falling characteristic at the boundary.

Embodiment B9

FIG. 62 is a block diagram showing the configuration of an imageencoding apparatus according to a B9th embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure. In the figure, multi-value to binaryconverting means (12601) is a means which takes a target image (with arange of values from 0 to 255, each being an integer) as an input, andwhich binarizes the input target image by assigning a value of 0 topixels of value 0 and a value of 255 to pixels of other values. Binaryimage encoding means (12602) is a means which encodes the binary imagehaving values of {0, 255} and outputs the encoded data. Smoothingfunction estimating means (12603) is means for determining a smoothingfunction.

Smoothing function encoding means (12604) is a means for encoding thethus determined function. Binary to multi-value converting means (12605)is a means which takes the smoothing function and binary image as inputsand reconstructs the multi-value image. Difference calculator (12606) isa means which obtains the difference between the output of the binary tomulti-value converting means (12605) and the target multi-value image.Residual encoding means (12607) is a means for encoding the difference.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below.

The blocks with numerals 2601 to 2605 are identical in configuration andoperation to the blocks of the same names previously described withreference to FIGS. 58 and 59. In the present embodiment, the imageencoding apparatus shown in the seventh embodiment is used as apredictor. That is, the output of the binary to multi-value convertingmeans (12605) is taken as a predicted image, and the difference of thepredicted image is obtained by the difference calculator (12606), thedifference then being encoded by the residual encoding means (12607).

For the encoding of the difference, the interframe coding mode (discretecosine transform coding) defined in CCITT's international standard formoving picture coding H.261 is used.

Embodiment B10

FIG. 63 is a block diagram showing the configuration of an imagedecoding apparatus according to a 10th embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure. Outputs from the image encoding apparatusof the ninth embodiment are supplied as inputs to the decoding apparatusof the present embodiment.

In the figure, binary image decoding means (12701) is a means whichtakes the output of the binary image encoding means (12602) as an inputand recovers the binary image of {0, 255} from the binary image encodeddata. Smoothing function decoding means (12702) is a decoding means fordecoding the output of the smoothing function encoding means (12604).Binary to multi-value converting means (12703) is a means which takesthe smoothing function and binary image as inputs and reconstructs themulti-value image. Residual decoding means (12704) is a means whichtakes the output of the residual encoding means (12607) as an input andobtains the residual. Adder (12705) adds the outputs of the binary tomulti-value converting means (12703) and residual decoding means(12704).

The operation of the thus configured image decoding apparatus of thepresent embodiment will be described below.

The blocks with numerals 2701 to 2703 are identical in configuration andoperation to the blocks of the same names previously described withreference to FIGS. 58 and 59. The residual decoding means (12704) usesthe interframe decoding mode as defined in the moving image coding H.261to correspond with the output of the residual encoding means (12607).The difference signal representing the difference between the targetmulti-value image in FIG. 41 and the image obtained by smoothing thebinary image is thus reconstructed, and the difference signal is addedin the adder (12705) to reconstruct the multi-value image. In the 9thand 10th embodiments, the image encoding method shown in the seventh andeighth embodiment is used for prediction, and the prediction residualcomponent is separately encoded, transmitted and stored, therebyachieving more accurate reproduction of the target multi-value image. Inparticular, by predicting an abrupt change in value at the boundary,high-frequency components can be removed from the residual signal, andthe efficiency of discrete cosine transform coding can thus be improved.

Embodiment B11

FIG. 64 is a block diagram showing the configuration of an imageencoding apparatus according to an 11th embodiment of the presentinvention. The configuration of this embodiment will be described belowwith reference to same figure.

In the figure, dynamic range estimating means (20101) is a means whichtakes a target multi-value image as an input, extracts the pixel valueof the largest area and the pixel value of the second largest area inthe multi-value image, and outputs them as a dynamic range.

Multi-value to binary converting means (20103) is a means which performsluminance conversion using the dynamic range, and applies thresholdingusing a predetermined threshold value to generate a binary image.

Smoothing function estimating means (20102) is a means which, byconsidering the thresholding performed in the multi-value to binaryconverting means (20103), analyzes luminance gradients in themulti-value image and estimates a smoothing function.

Dynamic range encoding means (20105) is a means which encodes thedynamic range and outputs the encoded data.

Smoothing function encoding means (20106) is a means which encodes thesmoothing function and outputs the encoded data.

Binary image encoding means (20104) is a means which encodes the binaryimage and outputs the encoded data.

The operation of the thus configured image encoding apparatus of thepresent embodiment will be described below with reference to FIGS. 40,49, etc., together with the operation of an image encoding methodaccording to one embodiment of the present invention.

The dynamic range estimating means (20101) extracts the pixel value ofthe largest area and the pixel value of the second largest area in themulti-value image; in many multi-value images, these pixel valuescoincide with the largest pixel value and the smallest pixel value,respectively, so that in the present embodiment, the largest pixel valueDmax and the smallest pixel value Dmin are extracted by scanning thetarget multi-value image.

The multi-value to binary converting means (20103) performs linearconversion, as shown in FIG. 40, and applies thresholding to each pixelvalue using a threshold value of 128 so that the maximum value Dmax isset to 255 and the minimum value Dmin is set to 0.

The smoothing function estimating means (20102) estimates the smoothingfunction by considering the thresholding performed by the multi-value tobinary converting means (20103) and the average of the gradients of thepixel values in the image. In the present embodiment, an average filterwith a reference point at its center is employed since the thresholdingis done using a threshold value of 128 in the multi-value to binaryconverting means (20103).

The size of the average filter is determined by the average of thegradients of the pixel values in the image.

The average, dave, of the gradients of the pixel values in the image iscalculated in the following manner.

In x-direction filtering (10301), the x-direction filter (10401) isapplied and scanned over the image to detect the gradient along thex-direction in the image.

In y-direction filtering (10302), the y-direction filter (10402) isapplied and scanned over the image to detect the gradient along they-direction in the image.

In gradient detection (10303), gradient d (i, j) is detected bycalculating the equation B1 given in the first embodiment using thex-direction gradient dx (i, j) obtained by the x-direction filtering(10301) and the y-direction gradient dy (i, j) obtained by they-direction filtering (10302), where (i, j) are the coordinates on theimage.

In gradient direction detection (10304), gradient direction θ (i, j) isdetected by calculating the equation B2 given in the first embodimentusing the x-direction gradient dx (i, j) obtained by the x-directionfiltering (10301) and the y-direction gradient dy (i, j) obtained by they-direction filtering (10302), where (i, j) are the coordinates on theimage.

In non-maximum value suppression (10305), using a window that changeswith θ, as shown in FIG. 40, an image is created in such a manner thatif the value of the gradient at the reference point within the window isa maximum value, the image portion at the coordinates of the referencepoint is assigned a value of 1; otherwise, the image portion at thecoordinates of the reference point is assigned a value of 0.

In average gradient detection (10306), average gradient d'ave isobtained by calculating the average of the gradients detected in thegradient detection (10303) for the pixels of value 1 in the binary imageobtained by the non-maximum value suppression (10305). Further, usingthe maximum pixel value Dmax and minimum pixel value Dmin detected bythe dynamic range estimating means (20101), normalized average gradientis recalculated from the equation B3 given in the first embodiment toobtain dave.

The size of the average filter is determined based on the normalizedaverage gradient dave and by referring to FIG. 49.

The binary image encoding means (20104) encodes the binary image byusing the binary image encoding scheme MMR defined in CCITT'sinternational standard traditionally used for facsimile systems, etc.,and outputs the encoded data.

The smoothing function encoding means (20106) encodes the smoothingfunction estimated by the smoothing function estimating means (20102),and outputs the encoded data. In the case of the present embodiment, thesize of the average filter is encoded for output as the encoded data.

The dynamic range encoding means (20105) individually encodes the Dmaxand Dmin obtained by the dynamic range estimating means (20101), andoutputs the encoded data.

As described above, in the present embodiment, by utilizing the propertyof a multi-value image that almost all pixels in the image have auniform minimum value or maximum value with intermediate valuesdistributed along the boundary, the multi-value image is converted intoa binary image, the state of the distribution of the intermediate valuesis analyzed, and a smoothing function that provides a good approximationof the intermediate value distribution is estimated. By individuallyencoding the estimated maximum pixel value and minimum pixel value, theestimated smoothing function, and the estimated binary image andoutputting the results as encoded data, efficient encoding can beachieved.

In any one of the above-described embodiments, a magnetic recordingmedium or an optical recording medium may be created that holds aprogram for having a computer implement the functions of all or part ofthe means so far described so that the program can be run on thecomputer to carry out the above-described operations.

The image encoding apparatus of the present invention has been describedin the above embodiments as including the dynamic range estimating meansand its encoding means, but this is not an essential condition; forexample, since, in many cases, Dmax is 255 and Dmin is 0, both of theabove means may be omitted. In that case, the image encoding apparatuscomprises, as shown in FIG. 65, smoothing function estimating means(10102) for estimating a smoothing function from a target multi-valueimage which is the image to be encoded; multi-value to binary convertingmeans (10103) for converting the multi-value image to a binary image inaccordance with a multi-value to binary conversion criterion determinedto match the estimated smoothing function; binary image encoding means(10104) for encoding the binary image and outputting the same as binaryimage encoded data; and smoothing function encoding means (10106) forencoding the estimated smoothing function and outputting the same assmoothing function encoded data. According to this configuration, thesmoothing function is estimated from the target multi-value image to beencoded; the multi-value image is converted to the binary image inaccordance with the multi-value to binary conversion criteriondetermined to match the estimated smoothing function; the binary imageis encoded and output as the binary image encoded data; and theestimated smoothing function is encoded and output as the smoothingfunction encoded data. In this case also, approximately the same effectsas those achieved in the first described configuration can be obtained.

Furthermore, the image encoding apparatus of the present invention hasbeen described in the above embodiments as including the smoothingfunction estimating means, but this is not an essential condition; forexample; a configuration that does not include the smoothing functionestimating means is also possible. In that case, the image encodingapparatus comprises, as shown in FIG. 66, multi-value to binaryconverting means for taking a target multi-value image to be encoded anda smoothing function as inputs, and for generating a binary image fromthe multi-value image on the basis of the smoothing function; binaryimage encoding means for encoding the binary image and outputting thesame as binary image encoded data; and smoothing function encoding meansfor encoding the smoothing function and outputting the same as smoothingfunction encoded data. The smoothing function is a predeterminedfunction so adjusted that the original multi-value image could, ineffect or in approximation fashion, be reproduced if the smoothingfunction were applied to the binary image. According to thisconfiguration, the target multi-value image to be encoded and thesmoothing function are input; the binary image is generated from themulti-value image on the basis of the smoothing function; the binaryimage is encoded and output as the binary image encoded data; and thesmoothing function is encoded and output as the smoothing functionencoded data. In this case also, approximately the same effects as thoseachieved in the first described configuration can be obtained.

The image encoding apparatus of the present invention has been describedin the embodiment illustrated in FIG. 66 as not including the dynamicrange estimating means, etc. but this is not an essential condition; forexample, a configuration including the dynamic range estimating means,etc. is also possible. In that case, the image encoding apparatuscomprises, in addition to the elements shown in FIG. 66, the dynamicrange estimating means for obtaining the dynamic range from the targetmulti-value image and the dynamic range encoding means for encoding thedynamic range and outputting the same as dynamic range encoded data, asshown in FIG. 67. In this configuration, the multi-value to binaryconverting means generates the binary image by also considering thedynamic range. In operation, this configuration involves, in addition tothe operation described in connection with the configuration of FIG. 66,obtaining the dynamic range from the target multi-value image, encodingthe dynamic range, and outputting the same as the dynamic range encodeddata.

Furthermore, the image encoding apparatus of the present invention hasbeen described in the embodiment illustrated in FIG. 64 as including thedynamic range estimating means, etc. but this is not an essentialcondition; for example, a configuration that does not include thedynamic range estimating means, etc. is also possible. In that case, theimage encoding apparatus comprises, as shown in FIG. 68, multi-value tobinary converting means (20103) for converting a target multi-valueimage, the image to be encoded, to a binary image in accordance with amulti-value to binary conversion criterion determined to match themulti-value image; smoothing function estimating means (20102) forestimating a smoothing function such that the original multi-value imagecould, in effect or in approximation fashion, be reproduced if the samesmoothing function is applied to the binary image; binary image encodingmeans (20104) for encoding the binary image and outputting the same asbinary image encoded data; and smoothing function encoding means (20106)for encoding the estimated smoothing function and outputting the same assmoothing function encoded data. According to this configuration, themulti-value image is converted to the binary image in accordance withthe multi-value to binary conversion criterion determined to match thetarget multi-value image to be encoded; the smoothing function thatcould, in effect or in approximation fashion, reproduce the originalmulti-value image if applied to the binary image is estimated; thebinary image is encoded and output as the binary image encoded data; andthe estimated smoothing function is encoded and output as the smoothingfunction encoded data. In this case also, approximately the same effectsas those achieved in the first described configuration can be obtained.

The image decoding apparatus of the present invention has been describedin the above embodiments as including the dynamic range decoding means,but this is not an essential condition; for example, a configurationthat does not include the dynamic range decoding means is also possible.In that case, the image decoding apparatus has the configuration thataccepts the various kinds of encoded data output from the image encodingapparatus shown in FIG. 58, 65, 66, or 68, and comprises, as shown inFIG. 69, binary image decoding means for recovering the binary image bydecoding the binary image encoded data out of the encoded data;smoothing function decoding means for recovering the smoothing functionby decoding the smoothing function encoded data out of the encoded data;and binary to multi-value converting means for recovering themulti-value image by smoothing the decoded binary image using thedecoded smoothing function. According to this configuration, the variouskinds of encoded data output from any one of the image encodingapparatuses are input; of the encoded data, the binary image encodeddata is decoded to recover the binary image; of the encoded data, thesmoothing function encoded data is decoded to recover the smoothingfunction; and the multi-value image is recovered by smoothing thedecoded binary image using the decoded smoothing function. In this casealso, approximately the same effects as those achieved in the firstdescribed configuration can be obtained.

As described above, using the image encoding apparatus, image decodingapparatus, image encoding method, and image decoding method of thepresent invention, more efficient encoding and decoding can be achievedthan when using the prior art multi-value image coding techniques, forthe reasons given below.

1. In a multi-value image, the distribution of intermediate values alongthe boundary between the maximum value region occupying a major portionof the image and the minimum value region also occupying a major portionis analyzed, and the smoothing function that provides a goodapproximation of the distribution is determined.

2. Based on the smoothing function determined in 1, a binary image isgenerated that has only two values, the maximum value and the minimumvalue.

3. The multi-value image is expressed by the smoothing functiondetermined in 1 and the binary image generated in 2 and encodedaccordingly.

4. At the decoder, the encoded smoothing function and binary image aredecoded to reconstruct the multi-value image.

As is apparent from the above description, the present invention has theadvantage of being able to achieve more efficient encoding and decodingthan can be achieved with the prior art.

Industrial Applicability

As described above, according to the present invention, by predicting apixel to be encoded, for example, from a previously obtained binaryimage having high correlation, and by encoding its difference, moreefficient encoding and decoding can be achieved than when using priorart binary image encoding and decoding techniques. Furthermore,according to the present invention, the distribution of intermediatevalues, for example, is analyzed, and a smoothing function thatapproximates the distribution and a binary base image that has only twovalues, the maximum value and the minimum value, are respectivelyencoded and then decoded, thereby achieving more efficient encoding anddecoding than can be achieved with the prior art.

What is claimed is:
 1. An image encoding method for encoding a targetbinary image using a reference binary image, comprising the steps of:dividing the target binary image into target blocks, each blockcontaining a plurality of pixels; dividing the reference binary imageinto reference blocks, each block containing a plurality of pixels;selecting a statistical model from a plurality of statistical models,based on the states of pixels surrounding a reference pixel in eachreference block, said reference pixel corresponding to a target pixel ineach target block; and providing encoded data for said each target blockby arithmetic encoding said target pixel based on said selectedstatistical model.
 2. An image encoding method according to claim 1,wherein said pixels surrounding said reference pixel in said referenceblock are pixels positioned within one pixel distance from saidreference pixel.
 3. An image encoding method according to claim 1,wherein said pixels surrounding said reference pixel in said referenceblock are four pixels positioned immediately above, immediately beneath,immediately left and immediately right for said reference pixel.
 4. Animage encoding method according to claim 1, 2, or 3, wherein saidselected statistical model is based on the states of pixels surroundingsaid target pixel.
 5. An image encoding method according to claim 4,wherein said pixels surrounding said target pixel are positionedimmediately above, immediately left, immediately left-above andimmediately right above from said target pixel.
 6. An image encodingapparatus for encoding a target binary image by using a reference binaryimage, said image encoding apparatus comprising: a first blocking devicewhich provides a target block containing a plurality of pixels from saidtarget binary image; a second blocking device which provides a referenceblock containing a plurality of pixels from said reference binary image;a statistical model selecting device which selects a statistical modelfrom a plurality of statistical models, based on the states of pixelssurrounding a reference pixel in said reference block, said referencepixel corresponding to a target pixel in said target block; and anarithmetic encoding device which provides encoded data for said targetblock by arithmetic encoding said target pixel based on said selectedstatistical model.
 7. An image encoding apparatus according to claim 6,wherein said pixels surrounding said reference pixel in said referenceblock are pixels positioned within one pixel distance from saidreference pixel.
 8. An image encoding apparatus according to claim 6,wherein said pixels surrounding said reference pixel in said referenceblock are four pixels positioned immediately above, immediately beneath,immediately left and immediately right for said reference pixel.
 9. Animage encoding apparatus according to claim 6, 7, or 8, wherein saidselected statistical model is based on the states of pixels surroundingsaid target pixel.
 10. An image encoding apparatus for encoding a targetbinary image by using a reference binary image, said image encodingapparatus comprising: first blocking means of providing a target blockcontaining a plurality of pixels from said target binary image; secondblocking means of providing a reference block containing a plurality ofpixels from said reference binary image; statistical model selectingmeans of selecting a statistical model from a plurality of statisticalmodels, based on the states of pixels surrounding a reference pixel insaid reference block, said reference pixel corresponding to a targetpixel in said target pixel in said target block; and arithmetic encodingmeans of providing encoded data for said target block by arithmeticencoding said target pixel based on said selected statistical model. 11.An image encoding apparatus according to claim 10, wherein said pixelssurrounding said reference pixel in said reference block are pixelspositioned within one pixel distance from said reference pixel.
 12. Animage encoding apparatus according to claim 10, wherein said pixelssurrounding said reference pixel in said reference block are four pixelspositioned immediately above, immediately beneath, immediately left andimmediately right for said reference pixel.
 13. An image encodingapparatus according to claim 10, 11, or 12, wherein said selectedstatistical model is based on the states of pixels surrounding saidtarget pixel.
 14. An image encoding apparatus according to claim 13,wherein said pixels surrounding said target pixel are positionedimmediately above, immediately left, immediately left-above andimmediately right-above from said target pixel.
 15. An image encodingmethod for encoding a target binary image using a reference binary imageon a block basis, comprising the steps of: dividing the target binaryimage into target blocks, each block containing a plurality of pixels;providing a motion compensated block for said target block from saidreference binary image using a motion compensation, said motioncompensated block containing a plurality of pixels; selecting astatistical model from a plurality of statistical models, based on thestates of pixels surrounding a reference pixel in said motioncompensated block, said reference pixel corresponding to a target pixelin said target block; and providing encoded data for said target blockby arithmetic encoding said target pixel based on said selectedstatistical model.